Page 1 of 1
I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:35:55-07:00
by diegomage
I scale this image with this command
convert img -scale 270% imgr
and I obtain this effect in the border
How I could convert i image without lose or change the colors
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:38:24-07:00
by fmw42
try
Code: Select all
convert PaeLa.png -sample 270% result.png
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:41:34-07:00
by diegomage
this works very thankyou
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:42:20-07:00
by fmw42
What is your IM version and platform? I do not get that effect even using your command:
Code: Select all
convert PaeLa.png -scale 270% result.png
Are you sure that is the command you actually used (not -resize nor -resample)
How did you view the result in zoomed view? What viewer? Perhaps your viewer is doing bilinear enlarging rather than pixel replication?
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:47:04-07:00
by diegomage
this is my version
Version: ImageMagick 7.0.6-0 Q16 x86_64 2017-07-12
http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:48:26-07:00
by diegomage
my command is scale my viewer is kolour paint (but i use a convert command for check the color and the color changed in the border too)
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T16:49:57-07:00
by diegomage
this is my result image using this command
convert img -scale 270% imgr
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-15T18:09:35-07:00
by fmw42
Using IM 6.9.6.7 Q16 and IM 7.0.6.7 Q16 HDRI, I get your same result when using -scale when zooming a factor of 8. But using -sample works fine for me in both versions when zooming a factor of 8. Try -sample.
See
http://www.imagemagick.org/script/comma ... php#sample
http://www.imagemagick.org/script/comma ... .php#scale
If you were using an integer enlargement (200%, 300%, 400% etc), then both should produce the same results with no new colors.
I am not sure about non-integer enlargement values, but it was my understanding that both -scale and -sample enlarged with the same method. So if this is correct, then perhaps there is a bug. However, if I am wrong and -scale enlarges by non-integer values by blending, then this result is correct.
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-16T02:18:54-07:00
by Bonzo
For your information V7 uses magick rather than convert. If you installed legacy programs convert will work but you will then be using a V6 version.
Re: I obtain rare effect when I scale a image in imagemagick
Posted: 2017-08-16T04:10:25-07:00
by magick
If you scale by whole integers 200, 300, and 400%, for example, no new colors are introduced. The scanlines are duplicated. However if you enlarge by a non-integer factor, new colors are introduced. Scanlines are blended. 270% is a factor of 2.7. So in the example you provide, new colors are expected.