Anti-aliasing

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
Carlos82

Anti-aliasing

Post by Carlos82 »

Is it activated by default in this command?
convert im_lanczos.bmp -unsharp 1.0×1.0+0.5+0.0 im_lanczos_sharp.bmp

If not, how to activate it?

Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Anti-aliasing

Post by anthony »

I am not quite certain how anti-aliasing relates to unsharp? They are VERY separate things, except for the fact they deal with edge effects.

The anti-aliasing settings in IM are basically used to avoid creating the extra 'mixed' colors along the edges of things like text, and drawn objects like lines and circles. Such mixed colors make the objects and text look smoother at low resolution (density) displays where the effects of a individual pixel can be highly visible.

Unsharp is completely unrelated to drawing, and thus anti-aliasing. It processes an existing image to try to make the edges of sharp color changes more pronounced and less blurred that other operations like resizing, JPEG compression or document scanning can produce.

As a operation it will completely ignore any anti-aliasing setting as such settings have no bearing on it.
The same goes for blur, resize, or another other full image processing operation.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Carlos82

Re: Anti-aliasing

Post by Carlos82 »

Sorry I wanted to type to this command:
convert im.bmp -resize 100x im_lanczos.bmp

But, if anti-aliasing is not related to resize operation, then, ¿why in this article it is said the text below?
The image above was downsampled with ImageMagick Version 6.0.1, with Lanczos filtering and anti-aliasing selected.
From: http://www.xs4all.nl/~bvdwolf/main/foto ... ample1.htm
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Anti-aliasing

Post by fmw42 »

Read all the details about -resize at http://www.imagemagick.org/Usage/resize/#resize especially the bottom half of the page about artifacts, filters and expert settings. Antialiasing depends upon the filter choice: to disable all antialiasing when shrinking images use -filter point
Carlos82

Re: Anti-aliasing

Post by Carlos82 »

Ok. So then my quoted sentence is non-sense since the antialias operator does not have any effect on -filter Lanczos, right?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Anti-aliasing

Post by fmw42 »

As far as I know +antialias works with text drawing not with -resize. see http://www.imagemagick.org/Usage/draw/#settings
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Anti-aliasing

Post by anthony »

Again anti-aliasing is a setting for drawing things like text and lines. Nothing to do with resizing.

However Resize is designed to merge image colors together so as to produce a better result, which can be mis-interpreted as being 'anti-aliasing', as it has similar effects. "Filters" (and "Interpolator") define the method used to determine HOW the colors should be merged to produce the color mixing.

If you do not want color mixing, then either use -sample instead of -resize or set -filter point before resizing. The sample operator does this without all the extra code the resize operator has for using resize filters, making it much faster.

Prehaps if you like to explain WHY you are interested in this we can help you further!


But, if anti-aliasing is not related to resize operation, then, ¿why in this article it is said the text below?
The image above was downsampled with ImageMagick Version 6.0.1, with Lanczos filtering and anti-aliasing selected.
From: http://www.xs4all.nl/~bvdwolf/main/foto ... ample1.htm
The person that wrote this was a user of various image processing packages, but did not truely understand the what 'Lanscoz' or other image filters ment. If he did he would have understood why the aliasing effects become reduced for either 'Gaussian' or 'Windowed Sinc' type resize functions. The former is typically classed as blurry but without 'aliasing' effects. The later which 'lanscoz' is but one type, is a properly signal re-sampling filter, though again some people still find it a little 'blurry'.

Note that this is to stop 'aliasing' artefacts appearing in resized images, it is NOT 'anti-aliasing'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply