Returned 5 Results for "image" Ordered By Relevance

Google image api [relevance: 3.7]


2007-05-03 Digg! icurtain Delcious icurtain Technorati icurtain


Trawling through the current image.google.com reply i've just posted a broken down version of what googles image search returns - just in case anyone is interested in ripping from it.

dyn.Img(
"1: embedded URL",
"2: ",
"3: google code?",
"4: picture Location",
"5: thumb width",
"6: thumb height",
"7: image alt",
"8: ",
"9: ",
"10: full picture dimension & size",
"11: ",
"12: host domain",
"13: ",
"14: ",
"15: google thumb image server location"
);


PHP Colour Changing Background Algorithm [relevance: 3.63]


2009-03-24 Digg! icurtain Delcious icurtain Technorati icurtain


This returns the average colour of an image in PHP using GD libraries and then, assuming you ahve no sense of design, you could use this to set the background colour of a page. This code can be slotted directly into the ImageHandler class also on this site

  1.    public function getAverageColour(){ 
  2.       $colours = array('red'=>0,'green'=>0,'blue'=>0); 
  3.       $count = 0; 
  4.       $rgbstring = null; 
  5.        
  6.       for ($i=0;$iimage);$i++){ 
  7.          for ($j=0;$jimage);$j++){ 
  8.             $rgb = imagecolorat($this->image, $i, $j); 
  9.             $ici = imagecolorsforindex($this->image, $rgb); 
  10.             //print_r($ici); 
  11.             foreach($colours as $key => $value){ 
  12.                $colours[$key] = $colours[$key] + $ici[$key]; 
  13.             } 
  14.          $count++; 
  15.          } 
  16.       } 
  17.       foreach($colours as $key => $value){ 
  18.                $colours[$key] = dechex(intval($colours[$key] / $count)); 
  19.                $rgbstring = $rgbstring . sprintf("%02s", $colours[$key]); 
  20.             } 
  21.       return $rgbstring;    
  22.    }

PHP Image handler.. and why PHP is limited in usefulness [relevance: 2.98]


2008-03-07 Digg! icurtain Delcious icurtain Technorati icurtain


This little application was an attempt to map an image into an array of pixel objects using the PHP GD libraries and it's made me painfully aware of how limited PHP is in it's ability to handle large or complex data structures.

Below is a simple piece of code that attempts to copy each pixel value from an image into a pixel object and store it in a 2 dimensional array - anything over 150x150px and you run out of memory/if you don't store it then it takes forever to process

The only way to implement this kind of functionality within PHP is to write a specific extension for that purpose.. but then that's not really PHP anymore and it means you have to mess around with your server configuration in order to make it work... oh for java on cheap boxes :(

  1.          
  2.  
  3.            
  4.  
  5.          class Pixel{ 
  6.  
  7.            
  8.  
  9.                      private $red = null; 
  10.  
  11.                      private $green = null; 
  12.  
  13.                      private $blue = null; 
  14.  
  15.                     
  16.  
  17.                      public function setFromCI($ci){ 
  18.  
  19.                                  $this->setRed($ci['red']); 
  20.  
  21.                                  $this->setGreen($ci['green']); 
  22.  
  23.                                  $this->setBlue($ci['blue']); 
  24.  
  25.            
  26.  
  27.                      } 
  28.  
  29.                     
  30.  
  31.                      public function getRed(){ 
  32.  
  33.                                  return $this->red; 
  34.  
  35.                      } 
  36.  
  37.                     
  38.  
  39.                      public function setRed($red){ 
  40.  
  41.                                  $this->red = $red; 
  42.  
  43.                      } 
  44.  
  45.                     
  46.  
  47.                      public function getGreen(){ 
  48.  
  49.                                  return $this->green; 
  50.  
  51.                      } 
  52.  
  53.                     
  54.  
  55.                      public function setGreen($green){ 
  56.  
  57.                                  $this->green = $green; 
  58.  
  59.                      } 
  60.  
  61.            
  62.  
  63.                      public function getBlue(){ 
  64.  
  65.                                  return $this->blue; 
  66.  
  67.                      } 
  68.  
  69.            
  70.  
  71.                      public function setBlue($blue){ 
  72.  
  73.                                  $this->blue = $blue; 
  74.  
  75.                      } 
  76.  
  77.            
  78.  
  79.          } 
  80.  
  81.            
  82.  
  83.            
  84.  
  85.          class Picture{ 
  86.  
  87.            
  88.  
  89.                      private $image = null; 
  90.  
  91.                      private $imageArray = null; 
  92.  
  93.            
  94.  
  95.                      public function loadImage($url){ 
  96.  
  97.                                              $this->image = imagecreatefromjpeg($url); 
  98.  
  99.                                             
  100.  
  101.                                              //print_r($this->image); 
  102.  
  103.                      } 
  104.  
  105.            
  106.  
  107.                      public function stats(){ 
  108.  
  109.                                  echo 'width: '.imagesx($this->image).' height: '.imagesy($this->image); 
  110.  
  111.                      } 
  112.  
  113.            
  114.  
  115.                      public function toArray(){ 
  116.  
  117.                                  $this->imageArray=null; 
  118.  
  119.                                  $x = imagesx($this->image); 
  120.  
  121.                                  $y = imagesy($this->image); 
  122.  
  123.                                 
  124.  
  125.                                 
  126.  
  127.                                  for ($i=0;$i<$x;$i++){ 
  128.  
  129.                                              for ($j=0;$j<$y;$j++){ 
  130.  
  131.                                                          $p = new Pixel(); 
  132.  
  133.                                                          $rgb = imagecolorat($this->image, $i, $j); 
  134.  
  135.                                                          $p->setFromCI(imagecolorsforindex($this->image, $rgb)); 
  136.  
  137.                                                          //echo 'i'.$i.'j'.$j.'-'; 
  138.  
  139.                                                          $this->imageArray[$i][$j] = $p; 
  140.  
  141.                                              } 
  142.  
  143.                                  }           
  144.  
  145.            
  146.  
  147.                      } 
  148.  
  149.            
  150.  
  151.                      public function fromArray(){ 
  152.  
  153.                                  $x = count($this->imageArray); 
  154.  
  155.                                  $y = count($this->imageArray,COUNT_RECURSIVE)/$x-1; 
  156.  
  157.                                  echo ' x '.$x.' y '.$y; 
  158.  
  159.                                  //$img = ImageCreateTrueColor($width, $height) 
  160.  
  161.                     
  162.  
  163.                      } 
  164.  
  165.                     
  166.  
  167.                      public function getPixelAt($i, $j){ 
  168.  
  169.                                  if($this->imageArray[$i][$j]!=null){ 
  170.  
  171.                                              return $this->imageArray[$i][$j]; 
  172.  
  173.                                  } 
  174.  
  175.            
  176.  
  177.                      }           
  178.  
  179.                     
  180.  
  181.          } 
  182.  
  183.            
  184.  
  185.          ?> 
  186.  
  187.            
  188.  
  189.            
  190.  
  191.            
  192.  
  193.          
  194.  
  195.            
  196.  
  197.            
  198.  
  199.          $pic = new Picture(); 
  200.  
  201.          $pic->loadImage('home.jpg'); 
  202.  
  203.          $pic->toArray(); 
  204.  
  205.          echo $pic->stats(); 
  206.  
  207.            
  208.  
  209.          $x = $pic->getPixelAt(114,114); 
  210.  
  211.          print('
    '); 
  212.  
  213.          echo $x->getGreen(); 
  214.  
  215.          print('
    '); 
  216.  
  217.          echo $x->getBlue(); 
  218.  
  219.          print('
    '); 
  220.  
  221.          echo $x->getRed(); 
  222.  
  223.          print('
    '); 
  224.  
  225.            
  226.  
  227.          $pic->fromArray(); 
  228.  
  229.            
  230.  
  231.          ?>

Used – Enforcing Web 2 Synergy [relevance: 2.84]


2007-04-23 Digg! icurtain Delcious icurtain Technorati icurtain


Used – Enforcing Web 2

Project URL http://www.sinrize.com

Key concepts are enforced user participation and generative art

Identity
The site automatically identifies the user’s IP address and the time that the user visits the site. This becomes their identity. They become numerically identifiable. This information is enough to track down and trace the precise computer from which the user connected to the net at the given time.

Tagging
This information is then used to physically tag the image. This tagging in turn degrades the image and reduces its quality – effectively adding a shelf life to what is traditionally viewed as a permanent digital form. This finite life span that now applies to views redefines the way that the image is viewed.

Actively Involving passive users // Degeneration // Permanence
It also forces the user to participate in the generative nature of the picture. All of the information, colours, text etc that are embedded into the picture when it is viewed are as a result of user data. This forces the passive user to participate within the project and become part of it. Effectively enforcing its web 2 nature and the user's synergy with the content.

User Input
If users are unhappy with an image or would like to see a change they can select any word that comes to their mind and suggest it to the site. The site will then attempt to look for another image that matches this key word and replace the old image with the newly imported one.

Copyright
Copyright. All the images this site rips are copyright to somebody and I have made no effort at all to try to interfere with any copyright issues relating to the picture. Provision has been made for users to mark any image as copyrighted and this will delete the original image and replace it with a “COPYRIGHT INFRACTION” notice.

Coding
This site was coded from the group up by myself in PHP. Using the flickr API, a stream ripper was written to extract data from flickr and pull images out from it. These images are ripped to the host server and then progressively generated/degenerated by server scripts adding tag data to each image.

Potential Bug
Flickr only allows access to it’s API when using a specifically generated Key. Flickr don’t really appreciate hug amounts of image data being ripped off their server and therefore the site can stop working when Flickr block individual keys. If this happens – contact me through http://www.bluemedia.co.uk/contact

User Instructions
Every time a user clicks on an image the image is tagged with the user IP address and time the user has viewed the image (according to the server).
The more frequently an image is viewed the further the original image will degenerate and the more tags from views will appear on the image.

The user can also choose to replace the image with another. Occasionally no image will be returned – in this case the process must be repeated.

If an image is in breach of copyright the user can select this option to remove the image content from the server and restore the balance of justice.

References: http://www.hackablekurator.org


Vista Style Buttons CSS [relevance: 2.79]


2008-03-11 Digg! icurtain Delcious icurtain Technorati icurtain


Resizable Vista style buttons with a gradient in XHTML/CSS

As I had to spend an entire afternoon trying to get these to work I might as well post them

To get your lovely Vista Style buttons just screen shot Vista or make a rectangle with 2 gradients that meet.. then add a boarder and blend the corner pixels onto whatever backdrop you want to put them on.

Vista Button CSS

.buttonLeft {
background-image: url(button-right.gif);
background-repeat: no-repeat;
background-position: top right;
display:block;
float:left;
/*external border spacing*/
margin:4px;
}

.buttonRight {
background-image: url(button-left.gif);
background-repeat: no-repeat;
background-position: top left;
display:block;
}

.buttonCentre{
/*line-height pushes the display block to the full height of the containing image*/
line-height:26px;
/*Inner boarders*/
margin-left:4px;
margin-right:4px;
background-image: url(button-centre.gif);
background-repeat: repeat-x ;
background-position: top left;
display:block;
}

span.buttonCentre:hover{
background: url(button-centre-hover.gif) ;
}
span.buttonLeft:hover {
background-image: url(button-right-hover.gif);
}
span.buttonRight:hover {
background-image: url(button-left-hover.gif);
}

And then all you have to do is make a few containing spans and you have your buttons

<span class="buttonLeft">
<span class="buttonRight">
<span class="buttonCentre">
buttonText
</span>
</span>
</span>

like this: buttonText

To conclude - these buttons are infinitely horizontally resizable and do display properly - however the hover does not work perfectly, if you hit the outer nested elements they will hover without making the internal elements hover..