Error DrawImage/3262

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
dark713
Posts: 6
Joined: 2016-06-27T20:16:33-07:00
Authentication code: 1151

Error DrawImage/3262

Post by dark713 »

Hello I'm trying to run through some tutorial to get rid of background I am trying to run this command but keep getting the error below. I've tried googling the specific number 3262 and it is non existent.

C:\test>convert 1a.png -bordercolor white -border 1x1 -fill none -fuzz 7% -draw "matte 1,1 floodfill" -shave 1x1 white_floodfill.png

convert: non-conforming drawing primitive definition `matte' @ error/draw.c/DrawImage/3262.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Error DrawImage/3262

Post by snibgo »

Please read IMPORTANT: Please Read This FIRST Before Posting

"3262" is the line number within draw.c that generated the error.
snibgo's IM pages: im.snibgo.com
dark713
Posts: 6
Joined: 2016-06-27T20:16:33-07:00
Authentication code: 1151

Re: Error DrawImage/3262

Post by dark713 »

Is that a file I can look in to see what its referring too? I don't seem to be finding it
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error DrawImage/3262

Post by fmw42 »

What version of Imagemagick are you using? Please always provide your IM version and platform when asking questions as per the link user snibgo provided.

In current versions, matte is replaced by alpha.
dark713
Posts: 6
Joined: 2016-06-27T20:16:33-07:00
Authentication code: 1151

Re: Error DrawImage/3262

Post by dark713 »

Version: ImageMagick 7.0.2-1 Q16 x64 2016-06-23 http://www.imagemagick.org

C:\test>convert 1.png -bordercolor white -border 1x1 -fill none -fuzz 7% -draw "alpha 1,1 floodfill" -shave 1x1 white_floodfill.png

This seems to be working so far
dark713
Posts: 6
Joined: 2016-06-27T20:16:33-07:00
Authentication code: 1151

Re: Error DrawImage/3262

Post by dark713 »

Does the -fill command work with -alpha anymore is there another term? Sorry pretty new to this

C:test>convert difference.png -bordercolor white -border 1x1 -alpha -fill none -fuzz 7% -draw "alpha 1,1 floodfill" -shave 1x1 removed_black.png

convert: UnrecognizedAlphaChannelOption `-fill' @ error/convert.c/ConvertImageCommand/706.
dark713
Posts: 6
Joined: 2016-06-27T20:16:33-07:00
Authentication code: 1151

Re: Error DrawImage/3262

Post by dark713 »

C:test>convert difference.png -bordercolor white -border 1x1 +alpha -fill none -fuzz 7% -draw "alpha 1,1 floodfill" -shave 1x1 removed_black.png

+alpha instead of - works
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error DrawImage/3262

Post by fmw42 »

Why do you want to put in -alpha? Your use of -fill none and -draw "alpha ..." should make it transparent. There is no +alpha that I know about. It is likely being ignored. If you want to turn off transparency, then use -alpha off or -alpha opaque just before your output. But then why use -draw "alpha ..." in the first place?

If you do need -alpha for some reason that I do not understand, then you need to specify the argument for -alpha, such as -alpha on/off/transparent/opaque/set etc. See http://www.imagemagick.org/Usage/masking/#alpha
dark713
Posts: 6
Joined: 2016-06-27T20:16:33-07:00
Authentication code: 1151

Re: Error DrawImage/3262

Post by dark713 »

trying to follow this example
# start real
convert tool.png \( +clone -fx 'p{0,0}' \) -compose Difference -composite -modulate 100,0 +matte difference.png

# remove the black, replace with transparency
convert difference.png -bordercolor white -border 1x1 -matte -fill none -fuzz 7% -draw 'matte 1,1 floodfill' -shave 1x1 removed_black.png
composite -compose Dst_Over -tile pattern:checkerboard removed_black.png removed_black_check.png

# create the matte
convert removed_black.png -channel matte -separate +matte matte.png

# negate the colors
convert matte.png -negate -blur 0x1 matte-negated.png

# you are going for: white interior, black exterior
composite -compose CopyOpacity matte-negated.png tool.png finished.png
composite -compose Dst_Over -tile pattern:checkerboard finished.png finished_check.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error DrawImage/3262

Post by fmw42 »

You are trying to copy an apparently very old example with outdated syntax.
convert difference.png -bordercolor white -border 1x1 -matte -fill none -fuzz 7% -draw 'matte 1,1 floodfill' -shave 1x1 removed_black.png
The -matte here is the old equivalent of the new -alpha set. But it is not needed. The -fill none ... -draw "alpha .." will enable the alpha channel automatically.

Composite is an old method that can be replaced with convert ... -composite. Thus you can in principle do everything in one command with appropriate use of parenthesis processing and clones.

See
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#clone

Can you point to the link to your example?
Post Reply