IM scales images differently on Linux than Mac os X

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?".
Post Reply
sim123

IM scales images differently on Linux than Mac os X

Post by sim123 »

Hi All,

I know very basic about IM (convert and identify) while scaling an image on Linux I get different results than scaling it on Mac Mac scales it correctly while Linux doesn't. Does IM is platform dependent or does it uses Core Image on MAC OS x?


I am using this command

Convert test.gif -resize 200x200> -write test-f.gif

I don't know how can I attach the file here, please let me know. Please help.

Thanks in advance for all the help and support.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM scales images differently on Linux than Mac os X

Post by fmw42 »

issue is likely how the ">" is being interpreted.

Try either

convert test.gif -resize '200x200>' test-f.gif

or

convert test.gif -resize 200x200\> test-f.gif


you don't need the -write in this case
sim123

Re: IM scales images differently on Linux than Mac os X

Post by sim123 »

Thanks for your response, but putting ' ' , / didn't help, I uploaded image and its results on following url

http://picasaweb.google.com/sim3159/Tes ... directlink

I am wondering if there is some problem with my installation or if IM uses core image on MAC so it can not produce same results on Linux as its producing for MAC. Please suggest

Thanks in advance for all the help and support.
sim123

Re: IM scales images differently on Linux than Mac os X

Post by sim123 »

Can some one please help me this issue, I have no clue what/where to look for it.

Thanks a lot.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM scales images differently on Linux than Mac os X

Post by fmw42 »

I looked at your imager and it has an alpha channel associated with it. I suspect that your two system's IM versions are handling resizing the alpha channel differently. Do you have the very same version of IM on both?

Check,

convert -list configure

to see your versions.

In any case, you can disable the alpha channel, then resize.

On my Mac OSX Tiger, IM 6.5.1-9 Q16, I get the following image when doing your command.

convert chinese.gif -resize '200x200>' chinese_mactiger.gif
Image

For some reason that I don't understand, this produces a strange result:
convert chinese.gif -alpha off -resize '200x200>' chinese_alpha_off_mactiger.gif
Image

But either of these work:

convert chinese.gif -alpha off miff:- | convert - -resize '200x200>' chinese_alpha_off2_mactiger.gif
Image

or

convert chinese.gif -alpha opaque -resize '200x200>' chinese_alpha_off3_mactiger.gif
Image

Note, that gif only supports boolean transparency. Thus resizing may be producing a non-boolean alpha. So you can try either using png rather than gif for your output or change the filter that IM uses to "point", e.g.

convert chinese.gif -filter point -resize '200x200>' chinese_filterpt_mactiger.gif
Image

see if either of those help on your Linux system.
sim123

Re: IM scales images differently on Linux than Mac os X

Post by sim123 »

Thanks it works. I had version issue on Linux, I should have checked it before troubling everyone on the forum. Alfa filter works too.

Thanks a lot for all the help.
Post Reply