Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Replace -colorspace RGB (which should have been -colorspace sRGB) with your final sRGB.icc profile. I have never heard of -alpha flatten. Also -alpha remove may need you to specify a background color. I am not sure what the default is. It may not be needed due to the -flatten again depending upon the default background color. Usually you can just set a background color and -flatten. Since JPG does not support transparency, removing the alpha should not be needed.
The above worked well for me in equivalent Unix syntax on IM 6.9.3.8 Q16 Mac OSX.
However, when looking at the verbose information for your EPS file, I see it already has a USWebCoatedSWOP.icc profile. So the following is sufficient (leaving out the first profile that your file already contains).
So, I ran another file and kaboom...I get an error..color profile operates on another colorspace. I see the file is a transparent PDF from Illustrator. This file did work previously so that probably why I put those flatten options in.
But, now I can't get any combination to work with this file...
That is because your pdf file in already sRGB. Using the CMYK profile tells IM that it is CMYK and then you convert it to sRGB using the second profile. This will definitely mess up your image.
You need to find out what colorspace you have and if any profiles and create a script conditional test to decide what profiles will be needed in your command line to convert your files.
See string formats for %[colorspace] and %[profiles] ( and possibly %[profile:icc] and %[profile:icm]) at http://www.imagemagick.org/script/escape.php. Also you may want to see if there is an alpha channel if you need to flatten or remove it if you are not use output JPG format. So perhaps also %[channels]. This would also tell you the colorspace.
So you can see if it is CMYK or sRGB, if there is an alpha, and what profiles it might have. Then you can form your command appropriately to use the correct number and types of profiles.
If you need to do this automatically, then you will need to write a short bat script to do the checking from the string formats above and pick the right pre-prepared command line.
Unfortunately, I work on a Mac (Unix) and do not know Windows scripting.
Yeah, I did that and I'm getting conflicting results. I ran -verbose on the file I was having issues with (2082_03_R05TFF_12oz.pdf) and IM reports it as sRGB. I check the file in Illustrator...the document mode is CMYK....the blend mode is CMYK and there are no embedded images. I even ran an Acrobat preflight report and it says the colorspace is CMYK. So, I'm not sure how it's being reported as both.
You may have a CMYK raster image imbedded in an sRGB PDF shell. I would remove the raster image from the PDF shell to get proper results. See pdfimage, another tool.
EXIFTOOL does not seem to show me any colorspace information. So perhaps it is buried in the xamp profile and Acrobat and Illustrator use information there. IM probably assigned it sRGB, since it found no colorspace information.
To be honest, I don't really know what to tell you.
If I open your file in Acrobat Reader it tells me;
OutputIntent
Identifier: CGATS TR 001
Info: U.S. Web Coated (SWOP) v2
So if you know it is CMYK, then try using the above CMYK profile and then a sRGB profile to convert to rgb. Does that work?
Going with the profile throws an error. So, what I did is a strip and then a colorspace. It's not ideal but it's the best setup thus far that will get all files (all tested anyway) going. Rather than using the implementation we used, we're gonna switch over to JMagick which should give us some better control over what's happening via api. That way we can do the evaluations and do the appropriate actions ie. apply a profile or not. Unfortunately, our end users can upload ANY file they want so it's a bit tricky. I really appreciate your help!