threshold does not work after updating my OS

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
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

threshold does not work after updating my OS

Post by tmelorc »

EDIT
Please, delete this post since I discovered what was going on. It was my fault. I was using only command line and didn't observe that the input image was corrupted (fully white). Thanks to Nautilus with thumbnails I could observe that.

Sorry guys and thanks for help.
================================

I'm using

Code: Select all

identify -version
Version: ImageMagick 7.0.3-8 Q16 x86_64 2016-11-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP 
Delegates (built-in): bzlib jng jpeg lzma png x zlib
and today I discovered that

Code: Select all

convert foo.jpg -threshold 40% out40.png
produces a full white image as output. This is happening on my both Linux machines.

So I can only suppose that the problem comes from the last update I did via apt-get.

Here is the log, where I observed some ghostscript updates.

Does anybody have some idea what is going on and how to fix?

Code: Select all

Upgrade: libavdevice-ffmpeg56:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), ffmpeg:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), linux-libc-dev:amd64 (4.4.0-51.72, 4.4.0-53.74), libavutil-ffmpeg54:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), libapt-inst2.0:amd64 (1.2.12~ubuntu16.04.1, 1.2.15ubuntu0.2), libavfilter-ffmpeg5:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), apt:amd64 (1.2.12~ubuntu16.04.1, 1.2.15ubuntu0.2), libgs9:amd64 (9.18~dfsg~0-0ubuntu2, 9.18~dfsg~0-0ubuntu2.3), libswresample-ffmpeg1:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), flashplugin-installer:amd64 (11.2.202.644ubuntu0.16.04.1, 24.0.0.186ubuntu0.16.04.1), libapt-pkg5.0:amd64 (1.2.12~ubuntu16.04.1, 1.2.15ubuntu0.2), libpostproc-ffmpeg53:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), firefox-locale-en:amd64 (50.0+linuxmint1+serena, 50.1.0+linuxmint1+serena), firefox-locale-pt:amd64 (50.0+linuxmint1+serena, 50.1.0+linuxmint1+serena), ghostscript:amd64 (9.18~dfsg~0-0ubuntu2, 9.18~dfsg~0-0ubuntu2.3), libgme0:amd64 (0.6.0-3, 0.6.0-3ubuntu0.16.04.1), apt-utils:amd64 (1.2.12~ubuntu16.04.1, 1.2.15ubuntu0.2), ghostscript-x:amd64 (9.18~dfsg~0-0ubuntu2, 9.18~dfsg~0-0ubuntu2.3), libswscale-ffmpeg3:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), libgs9-common:amd64 (9.18~dfsg~0-0ubuntu2, 9.18~dfsg~0-0ubuntu2.3), libavresample-ffmpeg2:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), firefox:amd64 (50.0+linuxmint1+serena, 50.1.0+linuxmint1+serena), libavformat-ffmpeg56:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), apt-transport-https:amd64 (1.2.12~ubuntu16.04.1, 1.2.15ubuntu0.2), libavcodec-ffmpeg-extra56:amd64 (7:2.8.8-0ubuntu0.16.04.1, 7:2.8.10-0ubuntu0.16.04.1), geogebra5:amd64 (5.0.298.0-50503, 5.0.306.0-50928), tzdata:amd64 (2016h-0ubuntu0.16.04, 2016j-0ubuntu0.16.04)
End-Date: 2016-12-17  12:28:45
Last edited by tmelorc on 2016-12-20T14:38:59-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: threshold does not work after updating my OS

Post by fmw42 »

Works fine on IM 7.0.4.0 Q16 Mac OSX.

Code: Select all

magick rose: -threshold 40% tmp.png
Try using magick rather than convert. Does that work. If not, then perhaps upgrade or re-install.
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: threshold does not work after updating my OS

Post by tmelorc »

The same with magick. It was working before. After I did apt-get upgrade the problem appeared. I'm using IM7 installed from the source, not from repository. Do you think that reinstall could help? The problem is that I also have some files from IM6 in /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9 and I don't know if they are being executed by some command.

I'm lost now.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: threshold does not work after updating my OS

Post by fmw42 »

Unfortunately, I know little about installation on Linux. You could uninstall all of IM 6 and reinstall IM 7. See http://www.imagemagick.org/script/advan ... .php#build
Delegates (built-in): bzlib jng jpeg lzma png x zlib
You also seem to have very few delegates, though, I am not sure anything else that might be missing would affect your problem.

Does it fail for the IM internal images, logo: or rose:?

Many of the items in your message refer to ffmpeg and ghostscript and neither are installed. You also do not have tiff or freetype or lcms or xml installed.
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: threshold does not work after updating my OS

Post by tmelorc »

fmw42 wrote:
Delegates (built-in): bzlib jng jpeg lzma png x zlib
You also seem to have very few delegates, though, I am not sure anything else that might be missing would affect your problem.

Does it fail for the IM internal images, logo: or rose:?

Many of the items in your message refer to ffmpeg and ghostscript and neither are installed. You also do not have tiff or freetype or lcms or xml installed.
Well, it works for logo: But logo: is not jpeg, right?

Also, you said about delegates. I don't know what it is. Should contain more options, like what?

You said that I don't have tiff or freetype and so on. Should they be on delegates? If yes, how to install?

Now I am confused because it worked for logo:
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: threshold does not work after updating my OS

Post by fmw42 »

My guess is that you cannot do a simple upgrade from IM 6 to IM 7. You need to do a proper basic install of IM 7, not an upgrade. But again I know little about Linux.
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: threshold does not work after updating my OS

Post by tmelorc »

fmw42 wrote:My guess is that you cannot do a simple upgrade from IM 6 to IM 7. You need to do a proper basic install of IM 7, not an upgrade. But again I know little about Linux.
OK, thanks for pointing me some news.

But IM7 was working 2 days ago and after I updated those packages, some tools stopped. I think that some new lib is not compatible with IM7.

I'll try to find some solution, because that job on splitting leaves is still in progress.

Regards.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: threshold does not work after updating my OS

Post by fmw42 »

I would suggest uninstalling both IM 6 and 7 and then doing an initial install of IM 7.
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: threshold does not work after updating my OS

Post by tmelorc »

No success. I removed IM 6 and IM7 and compiled from source IM7 but no progress.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: threshold does not work after updating my OS

Post by fmw42 »

Did you install all the needed delegates first when you installing IM from source? The source files for IM do not install delegates. You have to do them manually or install from binary. See the binary page at http://www.imagemagick.org/script/binary-releases.php

I do not recall if you said what OS you are using.
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: threshold does not work after updating my OS

Post by tmelorc »

fmw42 wrote:Did you install all the needed delegates first when you installing IM from source? The source files for IM do not install delegates. You have to do them manually or install from binary. See the binary page at http://www.imagemagick.org/script/binary-releases.php

I do not recall if you said what OS you are using.
Sorry, I think that you didn't see the edit on my post. It was my mistake.

You asked Did you install all the needed delegates. Well, no. I don't know how to do this.

I am using Linux Mint. So no binary to it. I compiled from source.

ps: I noticed that you reported the bug on connected component. Nice! it was fixed. I'm glad to helped a little.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: threshold does not work after updating my OS

Post by fmw42 »

Installing delegates manually before an installing IM from source can be a pain to get it working. Each delegate must install properly and to do that other delegates may need installing first. So unless you have a way to install delegates, such as on the Mac from MacPorts or Homebrew, then I would not recommend that. But see the delegates at http://www.imagemagick.org/download/delegates/

How did you get IM installed in the first place? Did it come with your OS? Did you use some tool to install it? I would suggest you do that again from scratch, now that you have your system cleaned.

Sorry, again, but I really am not a Linux expert and so have no good suggestions. If you cannot install IM 7 successfully, then perhaps you should go back to IM 6.
Post Reply