Page 1 of 1

IM scales images differently on Linux than Mac os X

Posted: 2009-04-28T17:47:54-07:00
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.

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

Posted: 2009-04-28T17:56:43-07:00
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

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

Posted: 2009-04-29T10:21:54-07:00
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.

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

Posted: 2009-04-29T15:08:18-07:00
by sim123
Can some one please help me this issue, I have no clue what/where to look for it.

Thanks a lot.

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

Posted: 2009-04-29T16:27:13-07:00
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.

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

Posted: 2009-04-29T18:01:22-07:00
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.