ImageMagick's convert tells me: no images defined

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
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

ImageMagick's convert tells me: no images defined

Post by Airon65 »

I tried to execute following command:

Code: Select all

convert 1.png -filter 'Jinc ( +clone -negate -morphology Distance Euclidean -level 50%,-50% )' -morphology Distance Euclidean -compose Plus -composite -level 43%,57% -resize 12.5% 1.png
It tells me: "convert: no images defined `1.png' @ error/convert.c/ConvertImageCommand/3187." but it is exists! I tried to execute that command with the debug option enabled:
convert 1.png -filter 'Jinc ( +clone -negate -morphology Distance Euclidean -level 50%,-50% )' -morphology Distance Euclidean -compose Plus -composite -level 43%,57% -resize 12.5% 1.png -debug all
I get this output: http://pastebin.com/gsw7KszH

What's wrong with my ImageMagick's configuration? I use the latest macOS.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick's convert tells me: no images defined

Post by fmw42 »

To do a debug. put debug all right after convert. Why do you have single quotes in your command?

Perhaps you are using Windows convert and not IM convert?

If in a .bat file, then you must double the % to %%

Why do you have -filter Jinc? It is a setting for -resize and so should come right before -resize. Though filter jinc is rather an odd one to be using? What are you trying to do?


Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620

For novices, see

viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Re: ImageMagick's convert tells me: no images defined

Post by Airon65 »

Thanks a lot for the reply! I use macOS Sierra 10.12.3 and its bash terminal. If you don't mind I'll answer to you with the commands from my terminal:

Code: Select all

$ ls -la 1.png 
-rw-r--r--@ 1 mavick  staff  657340 26 feb 11:26 1.png

$ convert -version
Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-04-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib jng jpeg lcms png tiff xml zlib

$ convert 1.png -filter Jinc ( +clone -negate -morphology Distance Euclidean -level 50%,-50% ) -morphology Distance Euclidean -compose Plus -composite -level 43%,57% -resize 12.5% 1.png
-bash: syntax error near unexpected token `('

$ convert 1.png -filter 'Jinc ( +clone -negate -morphology Distance Euclidean -level 50%,-50% )' -morphology Distance Euclidean -compose Plus -composite -level 43%,57% -resize 12.5% 1.png
convert: no images defined `1.png' @ error/convert.c/ConvertImageCommand/3187.

$ convert -debug all 1.png -filter 'Jinc ( +clone -negate -morphology Distance Euclidean -level 50%,-50% )' -morphology Distance Euclidean -compose Plus -composite -level 43%,57% -resize 12.5% 1.png 2> output.txt

$ open output.txt
// I've just uploaded it here: http://pastebin.com/UQbuTJr4

$ convert 1.png -filter 'Jinc ( +clone -negate -morphology Distance Euclidean -level 50%,-50% )' -resize 12.5% -morphology Distance Euclidean -compose Plus -composite -level 43%,57% 1.png
convert: no images defined `1.png' @ error/convert.c/ConvertImageCommand/3187.
I've uploaded new `-debug all` output here: http://pastebin.com/UQbuTJr4

As for my task: I'm preparing my big image for using it as SDF font. It needs to be downsampled 8 times. Actually I don't know why do I use "Jinc" filter. It was just written in the tutorial for the SDF technology :) and I just use that command.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick's convert tells me: no images defined

Post by fmw42 »

In Unix you must escape parenthesis as \( .... \). No quote are needed. Can you post a link to your SDF technology where it says to use filter jinc?. Again the -filter jinc needs to be just before -resize. It does not relate to any other command that I know.

See
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/compose/
http://www.imagemagick.org/Usage/basics/#clone
http://www.imagemagick.org/Usage/filter/
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Re: ImageMagick's convert tells me: no images defined

Post by Airon65 »

As for the link to that tutorial actually it's on Russian language: https://habrahabr.ru/post/282191/
In Unix you must escape parenthesis as \( .... \). No quote are needed.
Wow it almost work! I got downsampled image:
Image

with the command:

Code: Select all

$ convert 4.png -filter Jinc \( +clone -negate -morphology Distance Euclidean -level 50%,-50% \) -resize 12.5% -morphology Distance Euclidean -compose Plus -composite -level 43%,57% 4r.png
I don't know why but they get blurred output images like this:
Image

Maybe some filter doesn't work for me? Why do I get output image so sharp? :) That algorithm based on contrast so it should looks blurred at this stage :)
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Re: ImageMagick's convert tells me: no images defined

Post by Airon65 »

If I use BW 8-bit png I get this result:

Image
but where's my chars? :)
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Re: ImageMagick's convert tells me: no images defined

Post by Airon65 »

Yep I finally got it! :)

Image

Unbelievable but now I get TOO much blurred image :) Could you please tell me how can I get the blurriness like here (ImageMagic section)? I get another output with imagemagick...
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick's convert tells me: no images defined

Post by snibgo »

Please paste a link to your input file, and show us your command.
snibgo's IM pages: im.snibgo.com
Post Reply