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?".
I use following commandline options to create rounded corners on an input photo. The rounded image is then placed on a white background.
Problem now is that there is a little bit of noise visible on the outside of the rounded corners. A few colored pixels near the rounded corners are visible on the white background.
Somehow in the composing process the pixels outside the corners are added. How can this be prevented? Can the rounded corners be made without the noisy pixels around them?
Here I zoomed in 500% on a corner of the rose image with rounded corners: http://screencast.com/t/WD0fCa6JGn
I used some red arrows to point out some of the noise pixels.
I also tested now with png output instead of jpg I was using earlier. http://screencast.com/t/WxSNTd8jnl
The png looks clean. No visible noise around the corners.
The output filesize is much bigger though and the performance with png is more time and memory consuming.
So I would love to hear some other optimizations!
Okay. With my conversion I can't see any bad pixels there, but using Gimp's eyedropper I can see that some pixels there are not exactly white -- for example they are rgb(249,248,254).
Jpeg is lossy which means it will in general change pixel values. This is most noticeable in areas of constant colour. The effect can be reduced by using a higher "-quality" setting. For example if I put "-quality 100" before the output filename the worst pixel is rgb(255,255,253).
The only way to guarantee that white stays white is by not compressing, or use only lossless compression. Png compression is lossless, and most "-compress" options for tiff are also lossless.
snibgo wrote:Okay. With my conversion I can't see any bad pixels there, but using Gimp's eyedropper I can see that some pixels there are not exactly white.
I converted the image using -gamma .02 to make the artifacts visible. The JPEG quality is already pretty high (92) when using IM-6.8.7-5; perhaps the reporter was
using an older version that uses quality 75 by default.
Ok, so I'm using png output now. There are no noise pixels added around the corners, but now I have the problem of aliasing.
The corners are not as smooth as I would like them to have (visible in the screenshot posted earlier).
I tested a bit with -blur but I was not getting smooth (anti-aliased) corners.
Could someone help me modify my convert command so that the corners are smooth, without adding other visible pixels around the corner areas?
Thanks!