PNG to SVG conversion fails with ImageMagick 7.0.8-64

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
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

I tried converting a PNG to a SCG image but fails getting an error as below:
---
Assertion failed: (image->blob->type != UndefinedStream), function WriteBlobStream, file MagickCore/blob.c, line 1554.
Abort trap: 6

I tested with ImageMagick 7.0.7-39 and PNG to SVG conversion sucseeds.
snibgo
Posts: 12159
Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by snibgo »

What version of IM fails?

You write "converting a PNG to a SCG" but I assume you mean "SVG".

There does seem to be a problem. With v7.0.8-64 on Windows 8.1:

Code: Select all

magick xc: x.svg
Fatal User Error 1002: Deadlock due to omp_set_lock being called on lock already owned by thread
EDIT to add: limiting to one thread doesn't help:

Code: Select all

magick -limit thread 1 xc: x.svg

Fatal User Error 1002: Deadlock due to omp_set_lock being called on lock already owned by thread
snibgo's IM pages: im.snibgo.com
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

Sorry my mistake.

Converting PNG to SVG fails with ImageMagick 7.0.8-64 on MacOS version 10.13.6.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by fmw42 »

ImageMagick will not vectorize the PNG into an SVG file, if that is what you expect.

It works fine for me on IM 7.0.10.65 Q16 Mac OSX Sierra with SVG renderer Inkscape.

However, I do get a message when trying the following on IM 6.9.10.65 Q16 Mac OSX Sierra with SVG renderer Inkscape.

Code: Select all

convert logo: logo.png
convert logo.png logo.svg

trace: illegal option -- -
  usage: trace -h [-v]
  usage: trace -i [-b numbufs]
  usage: trace -g
  usage: trace -d [-a pid | -x pid ]
  usage: trace -r
  usage: trace -n
  usage: trace -e [ -c class [[-s subclass]... | -p class ]]... | 
                  [-k code | -k code | -k code | -k code] [-P] [-T tracefilter] 
                  [-a pid | -x pid] 

  usage: trace -E [ -c class [[-s subclass]... | -p class ]]... | 
                  [-k code | -k code | -k code | -k code] [-P] [-T tracefilter] 
                  executable_path [optional args to executable] 

  usage: trace -L RawFilename [-S SecsToRun]
  usage: trace -l RawFilename
  usage: trace -R RawFilename [-X] [-F frequency] [-o OutputFilename] [-N] [ExtraCodeFilename1 ExtraCodeFilename2 ...]
  usage: trace -t [-o OutputFilename] [-N] [ExtraCodeFilename1 ExtraCodeFilename2 ...]
  Trace will import /usr/share/misc/trace.codes as a default codefile unless -N is specified. Extra codefiles specified are used in addition to the default codefile.
convert: delegate failed `'trace' --svg --output '%o' '%i'' @ error/delegate.c/InvokeDelegate/1928.

But, it works fine for IM 6.9.4.0
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

I don't expect that ImageMagick converts raster image to vectorized image.
Without Inkscape, ImageMagick 7.0.7-39 can convert a PNG file to a SVG(embedded data:image/png;base64) file.
But ImageMagick 7.0.8-64 fails.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by fmw42 »

It worked for me with 7.0.8.65. So perhaps the issue was fixed. Try that version.
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

Thanks for your help.
I tried mageMagick 7.0.8-65.
But this time conversion failed end up with:
---
convert: delegate failed `'potrace' --svg --output '%o' '%i'' @ error/delegate.c/InvokeDelegate/1867.

For now, I use ImageMagick 7.0.7-39 to convert PNG to SVG.
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

For reference:

1. I install potrace-1.16.mac-x86_64 from Potrace and run:

Code: Select all

convert logo.png logo.svg
2. ImageMagick 7.0.8-65 converts PNG to SVG(monochrome vectorized) image.

Image

3. ImageMagick 7.0.7-39 converts PNG to SVG(embedded data:image/png;base64) image, though.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by fmw42 »

add -verbose to your commands for each version of IM and see what tools and versions are being used.

Perhaps the delegates for SVG in delegates.xml are set up differently.

Is Potrace your SVG delegate? See delegates.xml
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

Thanks.
I looked into delegates.xml.
<delegate decode="pnm" encode="trace" command="&quot;potrace&quot; --svg --output &quot;%o&quot; &quot;%i&quot;"/> part only exists in ImageMagick 7.0.8-65.
And that part seemed to be added in ImageMagick 7.0.8-62.
So I tried ImageMagick 7.0.8-61 and I get the same results as ImageMagick 7.0.7-39.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by fmw42 »

Wait for one of the ImageMagick developers to comment. It is now beyond my knowledge.
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

Change.log
https://imagemagick.org/script/changelog.php
2019-08-19 7.0.8-62 Cristy <quetzlzacatenango@image...>
More robust support for converting bitmap to vector.
or
More robust support for converting bitmap to vector
https://github.com/ImageMagick/ImageMag ... b9f80c60c0

seems to be related, I think.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T18:32:55+00:00

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by magick »

We tried PNG to SVG convert with ImageMagick-7.0.8-65 under Windows 10. The conversion completed successfully without complaint.
eiichi
Posts: 19
Joined: 2017-02-09T02:22:14+00:00
Authentication code: 1151

Re: PNG to SVG conversion fails with ImageMagick 7.0.8-64

Post by eiichi »

Thanks for your reply.
I'm using ImgeMagick of my own building on macOS 10.13.6.
I'll look closer at this issue.
Post Reply