[RESOLVED] possible bug draw IM 6.7.6.7 Q16

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

[RESOLVED] possible bug draw IM 6.7.6.7 Q16

Post by fmw42 »

IM 6.7.6.7 Q16 Mac OSX Snow Leopard

Why aren't all these images antialiased when using -draw?

convert -size 100x100 xc:black -fill white -draw "line 0,0 99,99" 1tmp1.png
convert -size 100x100 xc:black -fill white -draw "line 0,0 99,99" -channel rgba -alpha on 1tmp2.png
convert -size 100x100 xc:black -fill white -antialias -draw "line 0,0 99,99" 1tmp3.png
convert -size 100x100 xc:black -fill white -antialias -draw "line 0,0 99,99" -alpha on 1tmp4.png
convert -size 100x100 xc:black -fill white -stroke white -draw "line 0,0 99,99" 1tmp5.png
convert -size 100x100 xc:black -fill white -stroke white -strokewidth 1 -draw "line 0,0 99,99" 1tmp6.png
convert -size 100x100 xc:black -fill white -stroke white -strokewidth 2 -draw "line 0,0 99,99" 1tmp7.png

Am I missing something or misunderstanding when -draw does antialiasing with lines?
Last edited by fmw42 on 2012-04-25T19:57:47-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug draw IM 6.7.6.7 Q16

Post by magick »

The lines are antialiased. Type
  • display 1tmp1.png
and click on the middle button for the magnify window. Press 4 while the pointer is in the magnify window. Do you see aliasing?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug draw IM 6.7.6.7 Q16

Post by fmw42 »

magick wrote:The lines are antialiased. Type
  • display 1tmp1.png
and click on the middle button for the magnify window. Press 4 while the pointer is in the magnify window. Do you see aliasing?

For some reason I cannot get into the zoom mode on my Mac Snow Leopard. I used to be able under Tiger. I don't know what is wrong,yet. I don't have a middle button, but it used to work with option-click or control-click, I do not remember.

But I have zoomed the image in several viewers other than display and they all show no antialiasing. Perhaps it is because the image is actually binary and there is no alpha channel?

The verbose info does not show any alpha channel nor does it show a histogram:


Image: 1tmp1.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 100x100+0+0
Resolution: 72x72
Print size: 1.38889x1.38889
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: Gray
Depth: 16-bit
Channel depth:
gray: 15-bit
Channel statistics:
Gray:
min: 0 (0)
max: 65535 (1)
mean: 766.666 (0.0116986)
standard deviation: 6556.4 (0.100044)
kurtosis: 92.2394
skewness: 9.64681
Colormap: 65536
Rendering intent: Perceptual
Gamma: 0.45455
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Interlace: None
Background color: white
Border color: gray(223,223,223)
Matte color: grey74
Transparent color: black
Compose: Over
Page geometry: 100x100+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2012-04-24T13:15:42-07:00
date:modify: 2012-04-24T13:15:42-07:00
png:bKGD : chunk was found (see Background color, above)
png:cHRM : chunk was found (see Chromaticity, above)
png:gAMA : gamma=0.45455 (See Gamma, above)
png:IHDR.bit_depth : 16
png:IHDR.color_type : 0
png:IHDR.interlace_method: 0
png:IHDR.width,height : 100, 100
png:pHYs : x_res=72, y_res=72, units=0
png:sRGB : intent=0 (See Rendering intent)
png:text : 2 tEXt/zTXt/iTXt chunks were found
signature: d7dc7fbdce86be081d28976b685a5efbd38b511dc8322f5e5107e216841bab15
Artifacts:
filename: 1tmp1.png
verbose: true
Tainted: False
Filesize: 396B
Number pixels: 10K
Pixels per second: 100TB
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.7.6-7 2012-04-22 Q16 http://www.imagemagick.org
c-98-234-217-52:~ fred$


Can you try on your Mac Lion when you get a chance?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug draw IM 6.7.6.7 Q16

Post by fmw42 »

Here is an example of what I get. You can download the image and see if you see any anti-aliasing.

convert -size 100x100 xc:black -fill white -draw "line 0,0 99,99" test_antialias.png

Image

This a piece of the image zoomed 2000%

Image


Edit:

magick wrote:display 1tmp1.png

and click on the middle button for the magnify window. Press 4 while the pointer is in the magnify window. Do you see aliasing?

I edited the X11 preferences to emulate a 3 button mouse and now I can zoom as per the above and the image still shows no sign of anti-aliasing.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug draw IM 6.7.6.7 Q16

Post by anthony »

Also see Draw and Colorspace....
http://www.imagemagick.org/Usage/draw/#colorspace

Drawing in sRGB colorspace often looks aliased. While doing so in linear RGB colorspace looks smoother (anti-aliased).

However Draw is doing anti-aliasing, unless +antialias option is used.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug draw IM 6.7.6.7 Q16

Post by fmw42 »

OK. Visually I cannot see any aliasing. However, this shows it is there but the values are rather few and dark.


convert -size 100x100 xc:black -fill white -draw "line 0,0 99,99" 1tmp1.png
convert 1tmp1.png -format "%c" histogram:info:
9702: ( 0, 0, 0) #000000000000 black
198: ( 5622, 5622, 5622) #15F615F615F6 gray(8.57862%,8.57862%,8.57862%)
100: (65535,65535,65535) #FFFFFFFFFFFF white


convert -size 100x100 xc:black -fill white +antialias -draw "line 0,0 99,99" 1tmp2.png
convert 1tmp2.png -format "%c" histogram:info:
9900: ( 0, 0, 0) #000000 black
100: (255,255,255) #FFFFFF white
Post Reply