Live data from Hacker News

ImageMagick: CLI for Image Editing

imagemagick.org

71–80 of 101 posts

Re: ImageMagick: CLI for Image Editing

#71
post #12

At my $OLDJOB, I used ImageMagick to compare snapshots during some automated front-end testing on our public Drupal site. It would compare the running test to previously accepted images, highlighting pixel diffs in red. It would also generate a 4 frame animated gif with of the original, highlit changes, the running test version, and back to the highlit changes (so it could loop for better comparison). Imagemagick sav…

Thanks for sharing this tip! Are there any guides you recommend? Edit: Here’s one guide for the legacy Imagemagick (may not work for the latest release), https://legacy.imagemagick.org/Usage/compare/ I’m trying to encourage my front end developers to use visual diffs to validate rendering rather than use Protractor to test HTML/CSS. I’ve known about BackstopJS, https://garris.github.io/BackstopJS/ and am on the looko…

A note of caution if you're planning to use Puppeteer for screenshots -- One oddity I've experienced with Puppeteer, is that there are sometimes very small height differences between headless and non-headless modes when generating screenshots. I suspect the root cause is that they are rounding sub-pixels differently, in certain scenarios. So, I typically run Puppeteer locally with { headless: false } to try to get a pixel-perfect match to the regular desktop Chrome experience.

Re: ImageMagick: CLI for Image Editing

#72

ImageMagick, ffmpeg, exiftool and YouTube-dl are 4 of the most useful tools via command line.

youtube-dl seems to be abandoned, now. yt-dlp (an actively developed fork of youtube-dl) seems to be it's accepted replacement, I think. fyi

Thank you for the heads up! Been sad to see the site list that youtube-dl works on slowly degrade and shrink.

Re: ImageMagick: CLI for Image Editing

#74
post #58
post #11

I always found it fascinating the grade-A executable names which imagemagick was able to claim in the global namespace: imagemagick /usr/bin/animate imagemagick /usr/bin/compare imagemagick /usr/bin/composite imagemagick /usr/bin/conjure imagemagick /usr/bin/convert imagemagick /usr/bin/display imagemagick /usr/bin/identify imagemagick /usr/bin/import imagemagick /usr/bin/mogrify imagemagick /usr/bin/montage imagemag…

No self-respecting Unix tool would use such long names, so that's why they were free. "compare" vs "cmp", etc.

A regrettable state that will hopefully be fixed someday.

Re: ImageMagick: CLI for Image Editing

#75
post #58

Earlier quoted context omitted.

No self-respecting Unix tool would use such long names, so that's why they were free. "compare" vs "cmp", etc.

Image magick isn't something you use frequently and quickly like changing directories or moving a file. A longer more descriptive name is better here. Also easier to speak. Telling someone to write "compare" is easier than "C-M-P"

I was trying to make a joke about the infamous naming practices of Unix, an operating system with a call named “creat”.

Re: ImageMagick: CLI for Image Editing

#76
post #58
post #11

I always found it fascinating the grade-A executable names which imagemagick was able to claim in the global namespace: imagemagick /usr/bin/animate imagemagick /usr/bin/compare imagemagick /usr/bin/composite imagemagick /usr/bin/conjure imagemagick /usr/bin/convert imagemagick /usr/bin/display imagemagick /usr/bin/identify imagemagick /usr/bin/import imagemagick /usr/bin/mogrify imagemagick /usr/bin/montage imagemag…

No self-respecting Unix tool would use such long names, so that's why they were free. "compare" vs "cmp", etc.

Spell create with an 'e'. - Ken Thompson (referring to design regrets on the UNIX creat(2) system call and the fallacy of premature optimization)

.. via https://github.com/globalcitizen/taoup

Re: ImageMagick: CLI for Image Editing

#77

Earlier quoted context omitted.

Thankfully as of v7 these are all bundled under a single "magick" command (with symlinks for compatibility). Hopefully in the future these can be removed

tbf this sounds like a problem that doesn't need to be fixed... Ironically this would introduce problems where many scripts sort of assume the binaries have the names they have.

Scripts written for version 6 or older are probably going to have problems with version 8 or later anyways as that's what the major version number is there to represent.

Re: ImageMagick: CLI for Image Editing

#78

Earlier quoted context omitted.

Imagemagick is one of the few bits of software where the functionality is worth the risk. Simply find a way to remove any network access and use it. I used to run it in a docker container with (almost) all capabilities dropped but with a directory mapped into it to run.

Not sure if this is common knowledge (??) but I feel I should note here: in my job we absolutely do not consider containers to be a security boundary[1]. On the other hand I still tend to use them for isolation on my personal boxen, because they at least reduce the blast radius of bugs or shitty packaging. [1] Random search result that appears to corroborate my claim: https://blog.aquasec.com/container-isolation

The article's sources disagree with the article. Its link to Microsoft's definition of a security boundary explicitly includes containers as a security boundary twice in the tables and offers bounties if you can break out of that security boundary. Its link and quote from Google say it's not a _strong_ security boundary yet the article claims Google said it wasn't a security boundary at all. The Red Hat link doesn't say anything about security boundaries whatsoever but it does say containers aren't perfect protection yet they do provide some protection. The Netflix link also explicitly says containers are a security boundary multiple times and they use additional protections to strengthen that boundary. At this point I'm doing following citations but you get the point.

If the security folks at your job truly doesn't consider containers security boundaries then they are wrong. What seems more likely is they don't consider containers alone a _good enough_ security boundary. And that's fine, some places consider separate processes with different rights good enough security boundaries. Others consider two boxes that are able to interact with each other not a good enough security boundary. It doesn't change that things that weren't secure enough for the use case are still security boundaries.

Re: ImageMagick: CLI for Image Editing

#79

If you ever need something actually performant or that uses far less memory, have a look at libVIPS

This is really interesting. In the past I've used netpbm for this kind of work, but it has been on life support for at least a decade now. I never used ImageMagick very much because each time I tried I found a new and exciting crash bug somewhere in the path, plus it tended to be much slower.

Most people have probably moved onto just using someone else to host and manipulate their images, but for business reasons, one of my apps stores its images (and all the cached sizes) in the DB (single source of truth is also nice) so switching to libVIPS enabled me to reduce the amount of compute resources I pay for

Re: ImageMagick: CLI for Image Editing

#80

ImageMagick is an incredible bit of kit. It really is a piece of magic that surrounds us daily, that most people don't ever think about, but is easy to use, and insanely powerful.

Ditto for ffmpeg when you move into the audio or video realms.

ffmpeg for video/audio, sox for audio fx.
Post reply on HN