Page 1 of 1

rgb() from pixel: ?

Posted: 2008-04-22T08:03:44-07:00
by el_supremo
The result of the command:

Code: Select all

convert logo: -format "%[pixel:u.p{0,0}]" info:
is

Code: Select all

white
Is there some way to force the output so that it is always in rgb() format?

Thanks
Pete

Re: rgb() from pixel: ?

Posted: 2008-04-22T09:37:07-07:00
by magick
Try:
  • convert logo: -format "rgb(%[fx:255.0*u.p{0,0}.r],%[fx:255.0*u.p{0,0}.g],%[fx:255.0*u.p{0,0}.b])" info:

Re: rgb() from pixel: ?

Posted: 2008-04-22T11:57:32-07:00
by el_supremo
Perfect, thanks!

Pete

Re: rgb() from pixel: ?

Posted: 2008-06-05T18:35:09-07:00
by anthony
Alturnativeally...

Code: Select all

   convert logo: -crop 1x1+0+0 -depth 8 txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: (255,255,255) #FFFFFF white
the color in parenthesis is either rgb or rgba (depending on transparency. Whcih form is specified in the output files header

See Im examples, TXT:
http://imagemagick.org/Usage/files/#txt