only need to determine colorspace of graphic
only need to determine colorspace of graphic
I have been using the identify -verbose command to determine what the colorspace of a graphic is from the log generated. Is there a quick and easy way to get the colorspace of a graphic without using the identify -verbose option?
Re: only need to determine colorspace of graphic
There is a fast way to get the image storage class and colorspace:
- -> identify -format %r logo:
PseudoClassRGB
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: only need to determine colorspace of graphic
Perhaps the colorspace can be added in the future to the list of string formats that one can return. I use this often also in my scripts and have to extract it from the -verbose info using sed commands. Not high priority as it can be done, but seems like a good thing to be able to get to easily. Future Enhancement request. Thanks.
This is what I have been doing in my scripts:
data=`identify -verbose $infile`
colorspace=`echo "$data" | sed -n 's/^.*Colorspace: \([^ ]*\).*$/\1/p'`
which can be combined as
identify -verbose $infile | sed -n 's/^.*Colorspace: \([^ ]*\).*$/\1/p'
for direct readout in a terminal window
This is what I have been doing in my scripts:
data=`identify -verbose $infile`
colorspace=`echo "$data" | sed -n 's/^.*Colorspace: \([^ ]*\).*$/\1/p'`
which can be combined as
identify -verbose $infile | sed -n 's/^.*Colorspace: \([^ ]*\).*$/\1/p'
for direct readout in a terminal window
Last edited by fmw42 on 2008-03-03T13:24:52-07:00, edited 1 time in total.
Re: only need to determine colorspace of graphic
Done. Tomorrow grab ImageMagick 6.3.9-2 Beta and use '%[colorspace]' to return just the image colorspace.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: only need to determine colorspace of graphic
Once again, magick, you amaze me at the speed at which you do some of these enhancements. That is terrific.
Re: only need to determine colorspace of graphic
I have downloaded the updated version 6.3.9-2 beta for windows ... I am not a programmer by trade so I need the command line for this new capability spelled out for me. Can you post a complete command line with the new %[colorspace] usage in it?
Re: only need to determine colorspace of graphic
Under Windows, try
- identify -format %[colorspace] image.jpg
- identify -format '%[colorspace]' image.jpg
Re: only need to determine colorspace of graphic
Is there a binary release for windows on this new upgrade?
Re: only need to determine colorspace of graphic
We do not provide Window binary distributions for ImageMagick Beta releases.