1

I'm trying to recreate an effect being used on pinterest at the moment to preload images. When you go on the page you'll notice each image has its own colour background that's been selected from the pre-loading image. How would I go about creating this effect?

Any jsfiddle examples of possible solutions would be hugely appreciated

Hellodan
  • 1,158
  • 4
  • 18
  • 38
  • since you want to know the color before the image arrives on the client, you'll have to do in with PHP on the server-side. http://stackoverflow.com/a/8730762/214446 – mb21 Jul 27 '14 at 09:32

1 Answers1

0

Interesting idea.

May not be exactly what you are looking for but PHPthumb makes a thumbnail of an image on the fly. A very small thumbnail that has been blurred will only be the whitewash, background, or color tone of the image.

Clearly there will be a need to cache the color images to remove potential performance issues.

ImageMagick http://php.net/manual/en/book.imagick.php would be required to do the image processing on the server, with phpthumb.

other php image processing options are documented http://php.net/manual/en/refs.utilspec.image.php

Wayne
  • 4,760
  • 1
  • 24
  • 24