Page 1 of 1

PNG to SVG conversion fails with ImageMagick 7.0.8-64

Posted: 2019-09-23T00:06:17-07:00
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.

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

Posted: 2019-09-23T04:01:13-07:00
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

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

Posted: 2019-09-23T04:33:17-07:00
by eiichi
Sorry my mistake.

Converting PNG to SVG fails with ImageMagick 7.0.8-64 on MacOS version 10.13.6.

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

Posted: 2019-09-23T10:07:18-07:00
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

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

Posted: 2019-09-23T20:56:26-07:00
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.

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

Posted: 2019-09-23T21:31:16-07:00
by fmw42
It worked for me with 7.0.8.65. So perhaps the issue was fixed. Try that version.

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

Posted: 2019-09-23T22:56:27-07:00
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.

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

Posted: 2019-09-24T03:59:18-07:00
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.

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

Posted: 2019-09-24T09:17:02-07:00
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

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

Posted: 2019-09-24T15:23:53-07:00
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.

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

Posted: 2019-09-24T18:55:25-07:00
by fmw42
Wait for one of the ImageMagick developers to comment. It is now beyond my knowledge.

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

Posted: 2019-09-24T19:35:54-07:00
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.

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

Posted: 2019-09-28T12:08:48-07:00
by magick
We tried PNG to SVG convert with ImageMagick-7.0.8-65 under Windows 10. The conversion completed successfully without complaint.

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

Posted: 2019-09-30T02:00:00-07:00
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.