Page 1 of 1

Command style affecting application of -colorspace

Posted: 2011-01-08T22:37:58-07:00
by itafroma
Starting with ImageMagick 6, the command style changed to solve a bunch of problems outlined in the Basic Usage document. That document does imply that for simple operations, one should only need to move the options from before the source file to between the source and output files to convert from the "old" style to the "new" style.

However, this doesn't seem to work for the -colorspace operation. When I use the following command, I get an output file with the correct colors:

Code: Select all

convert -colorspace rgb input.pdf output.png
But when I try to use the new command style, the -colorspace operation is never applied:

Code: Select all

convert input.pdf -colorspace rgb output.png
Why does this occur?

Re: Command style affecting application of -colorspace

Posted: 2011-01-09T13:37:55-07:00
by fmw42
for pdf files, you need to tell it -colorspace (and density, etc) before reading the file (as it is generally a vector format), but esp. if the file contains cmyk images

this is proper syntax for pdf and other images than need information before they are read. but most files work with the input image specified before the options.

see http://www.imagemagick.org/Usage/basics/#why and http://www.imagemagick.org/Usage/formats/#profiles

Re: Command style affecting application of -colorspace

Posted: 2011-01-10T22:20:31-07:00
by itafroma
Awesome, thanks for clarifying that. Wanted to make sure I wasn't missing something. :)

Re: Command style affecting application of -colorspace

Posted: 2011-01-11T17:12:33-07:00
by anthony
You need to remember that image reading (filename given as argument) is itself a image processing operation, which some setting can effect.

-colorspace is unusual in that it is an operation which for some reason can also effect image reading.

That is a little nonsensical, but seems unavoidable, -set colorspace may make more sense.