User:Eleanorg/1.2/Forbidden Pixels/extracting pixel colours

From XPUB & Lens-Based wiki
< User:Eleanorg‎ | 1.2/Forbidden Pixels
Revision as of 14:14, 19 January 2012 by Eleanorg (talk | contribs) (Created page with "Aim: to break an image down into a list of each pixel's position & colour, so that it can be re-created with html & css. Each pixel becomes an area coloured with a #hex code; thu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Aim: to break an image down into a list of each pixel's position & colour, so that it can be re-created with html & css. Each pixel becomes an area coloured with a #hex code; thus manipulable - and no longer strictly part of an image. Question: how to write a script that will extract a grid of pixel colours from a given image?

ImageMagick colour extraction

Command syntax: convert imagename.png -format '%[pixel:p{xpos,ypos}]' info:-

# convert 20by10PixelsSection1.png -format '%[pixel:p{20,10}]' info:-
rgba(135,161,160,1)