Page 1 of 1

Struggling with color, output coming out neon

Posted: 2014-06-09T08:52:35-07:00
by bowentw
Hi all,

I'm new to imagemagick so bear with me....

I'm converting a series of ai files to jpg/png, but I'm having some trouble matching the color. The output seems to have a kind of 'neon' effect to it. I'm sure it's a colorspace or a conversion issue but any help or guidance would be greatly appreciated. The ai files are in cmyk space. Here's my python code...

Code: Select all

for file in self.filteredFiles:
                        print('Converting ' + file)
                        myFileName = file.split('/')[1]
                        print(myFileName)
                        #myConvertName = file[:-3] + '.jpg'
                        #print(myConvertName)
                        with Image(filename=file, resolution = (RESOLUTION,RESOLUTION)) as myFile:     
                                myFile.resolution = RESOLUTION
                                myFile.depth = 32
                                myFile.format = 'png'
                                myFile.type = 'truecolor'
                                myFile.colorspace = 'cmyk'
                                myConvertName = myDir + '/' + 'default_' + myFileName[:-2] + 'png'

                                with myFile.convert('jpg') as converted:
                                        converted.depth = 32
                                        converted.colorspace = 'rgb'
                                        converted.save (filename = myConvertName)

Re: Struggling with color, output coming out neon

Posted: 2014-06-09T09:16:22-07:00
by snibgo
I don't know enough python, but "converted.depth = 32" is probably wrong. In IM, depth is bits/channel/pixel, so you probably want "8".

Sample files would help diagnosis.

Re: Struggling with color, output coming out neon

Posted: 2014-06-09T09:56:52-07:00
by bowentw
I'm afraid I can't provide too much of the image, but this should give you an idea (input on left, output on right). Basically the commands in python are the same as the standard command line but in a different syntax.

Image

Re: Struggling with color, output coming out neon

Posted: 2014-06-09T09:58:54-07:00
by fmw42
This is likely due to using IM to change colorspace using -colorspace equivalent in your API. You should use profiles to go from CMYK to sRGB.

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

Re: Struggling with color, output coming out neon

Posted: 2014-06-09T11:38:46-07:00
by bowentw
Perfect! That did the trick! Thank you Fred!