rgb() from pixel: ?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

rgb() from pixel: ?

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: rgb() from pixel: ?

Post 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:
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: rgb() from pixel: ?

Post by el_supremo »

Perfect, thanks!

Pete
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: rgb() from pixel: ?

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply