Examples website has incorrect entry

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
Dekker Dreyer

Examples website has incorrect entry

Post by Dekker Dreyer »

I'm following the example on the examples website for converting a png with transparency to jpeg.
If this could be a problem the best idea is to have IM replace the transparency with a better color by using either a "-flatten", "-border" or, "-frame" operator to compose the image over a solid color background. Or tile an image underneath.

convert a.png -background skyblue -flatten a_flatten.jpg

Attempting this gives me an error:

Code: Select all

/usr/bin/convert image.png -background black -flatten image.jpg
convert: Unable to flatten image (image sequence required).
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Examples website has incorrect entry

Post by magick »

If anything fails on the examples website, upgrade. The examples website always depends on the very latest ImageMagick release, which is currently ImageMagick 6.3.3-6.
Dekker Dreyer

Re: Examples website has incorrect entry

Post by Dekker Dreyer »

I assumed it would be the other way around. Foolish of me, thanks!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Examples website has incorrect entry

Post by anthony »

In general I try to keep things up-to-date on the IM examples. However I also try to note major changes when they happen. Not being able to flatten a single image was in a very earily release of IM v6, and deems a bug that was fixed at that time. It was not thought to be worth noting as it was a bug that was reported and fixed very quickly.

Similar bugs were found in -border and -frame and these were fixed when they were found. Oftenn because I started to expoler and experiment with the operator in IM examples.

Resize for example is one area I have not fully explored in IM examples, and as such it has probably not been fully-bugged in terms of its virtual canvas handling. Other areas yet to be looked at fully include image comparsions, convolution techniques, and Video handling.

I have also now started removing some rather verbose sections on IM v5 problems, that have not been relevent for more than 5 years. Speciafically handling -append in the legacy command line way. IM version 6 should have by now replaced IM v5, and any code that still depend on IM v5 quirks are just asking for trouble.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply