r/imagemagick • • Jun 29 '21

I wrote a script with imagemagick to split an image consisting of several things on an even background into several individual images, ready-made to be used as emojis and/or emotes (details in comment)

Thumbnail
delayforreddit.com
15 Upvotes

r/imagemagick • • Oct 18 '22

Imagemagick did an obscenely good job compressing an image?

14 Upvotes

There’s gotta be something I’m misunderstanding.

I like fiddling with the command-line tool, poking at some of the effects. Today in a complete brain fart, I ran convert original.png out.png. But then I noticed the file sizes: (4K image)

  • Original: 25M

  • output: 134k

I compared them by eye, and even ran the compare tool, and the two images are precisely identical, aside from filesize. The puzzling part is, the “original” was output by imagemagick itself.

The pipeline of this image was:

  1. Downloaded a neat wallpaper

  2. Manually do massive color adjusting in GIMP

  3. Obliterate the image with: convert in.png -enhance -enhance …x700… -enhance out.png

The end of that resulted in the 25M image, and was the “original” at the start of this post.

Link to images, compressed to hell


r/imagemagick • • Jul 26 '26

Poincaré disks with GMIC and ImageMagick in a bash script

Thumbnail
gallery
11 Upvotes

M.C. Escher used the Poincaré disk model to create his famous Circle Limit woodcuts, showing how an infinite hyperbolic plane fits inside a finite circle. The artist was inspired by mathematician H.S.M. Coxeter's work to pack repeating patterns of fish, angels, and devils that shrink smaller and smaller toward the edge.

I've used a mathematical image manipulator (GMIC) to create Poincaré disks from a few architectural photos I shot this week.

Photos were converted with Darktable, then GMIC was applied to generate a Poincaré disk and finally ImageMagick was used to combine the disks with a dropshadow on a white background.


r/imagemagick • • Feb 15 '23

Imagemagick saved my printing business from the doom

11 Upvotes

Me and my coworker always had to dealt with resizing images and making sure that customers always get the size of the picture they want when printed. Sometimes even compiling many 80 individual images centering them and then printing them, like `mkdir pr; for i in *.png; do convert $i -resize 600x -background white -gravity center -extent 2480x5508 pr/$i` which resizes batches of png pictures into the appropriate picture with width of 2 inches (using 300 pixels per inches), putting it in a 300 dpi A4 bondpaper, and centering it. And even if the files were in a exotic file format, not suitable for printing like webp, then imagemagick can even do that in a single command!

Sometimes I also had to make 2x2 and 1x1 pictures for the customer, so I first make the 2x2 (600x600 pixel) picture in a editing software, and then later resize it to 300x300 pixel with imagemagick. And if the costumer requested 5 copies of 2x2 and 8 copies for 1x1, then I can simply pack the pictures again and again in a single command with pprint `pprint -b image1x1.png 8 image2x2.png 5`.

So that's how imagemagick saved my ass.


r/imagemagick • • Aug 10 '14

Insanity wolf!

10 Upvotes
  convert -composite ~/Desktop/insanity-wolf-meme-template.jpg \
  xc:skyblue -fill white -stroke black -strokewidth 2 \
  -font Impact-Regular -pointsize 70 -gravity center \
  -draw "text 0,-220 'MAKES A MEME' text 0,220 'IMAGEMAGICK'" \
  linuxmeme.jpg

Result: linuxmeme.jpg


r/imagemagick • • Jul 18 '24

Is imagemagick.org down?

8 Upvotes

Hi Team,

Is imagemagick.org down?

Can somebody share the mirror website of imagemagick, from where we can download?


r/imagemagick • • Mar 19 '22

Making a PDF look hand-signed with Imagemagick

Thumbnail
frankzliu.com
6 Upvotes

r/imagemagick • • Jan 24 '21

ImageMagick - better than you know

Thumbnail
youtube.com
6 Upvotes

r/imagemagick • • Mar 11 '15

[imagemagick] Long shot since no one appears to have been active here in 7 months....

6 Upvotes

I'd like to have a one-line convert command that takes an image (arbitrary dimensions), and fills the background to a certain aspect ratio (16:9 in this case) with a blurred version of the original, possibly darkened. This is for a wallpaper.

Original
Desired result (drop shadow on the foreground would be nice if possible)

Scaling of the original is irrelevant. I'm using Variety, the wallpaper switcher, and it has an option to apply custom 1-line convert filters to the random wallpaper, I just it to filter the image to the proper aspect with the blurred background. Is this possible?


EDIT: Got it! Managed to figure out a way to do it, although it's tied to my screen resolution instead of the overall image aspect, but since it's applied dynamically on-the-fly to a temp image instead of the high-res original, that's okay for my purposes.

convert \( -clone 0 -resize 1366x768^ -fill black -colorize 50% -blur 64x40 \) 
    \( -clone 0 -bordercolor black -border 1x1 -resize 1366x768 \) 
    -delete 0 -gravity center -composite -extent 1366x768

(Backslashes are escaped for use on Linux. Not properly delineated for multi-line use in the console. Make sure to put it all on one line if you use it)

filter9 = False|Pad with Blur| \( -clone 0 -resize 1366x768^ -fill black -colorize 50% -blur 64x40 \) \( -clone 0 -bordercolor black -border 1x1 -resize 1366x768 \) -delete 0 -gravity center -composite -extent 1366x768

Add this into ~\.config\variety.conf to add the filter into preferences. Make sure to change screen resolution parts as appropriate.

Here is the result on one of my more squareish wallpapers. Very satisfying, if I do say so myself.


r/imagemagick • • Dec 12 '24

I made a Windows Batch file to convert bulk PDFs to JPG or any supported image within all subdirectories

5 Upvotes

Install ImageMagick. Then paste the below code in a .BAT file in the root directory of where you want all PDFs and all subdirectories containing a PDF to be converted to an image. Multi-page PDFs are supported. Run it in the command prompt.

I was searching for numerous hours trying to find an easy way to automate and convert 1,000+ PDFs in numerous subdirectories quickly to an image with decent quality, while keeping them in the same directory as the original PDF. I found ImageMagick and settled on .JPG because it was a lot faster than .PNG. The quality is set to high for speed, adjust as needed. Adjust density for desired dimensions.

@echo off
cls
for /r %%i in (*.pdf) do (
  echo %%i
  magick -density 250 "%%i" -quality 100 -background white ^
    -alpha remove -alpha off "%%~dpni-%%02d.jpg"
)

I hope someone finds this useful who does not want to do coding just to convert a ton of PDFs to images.
Thank you ImageMagick Team for a great program.


r/imagemagick • • Nov 17 '24

Please share your best magick commands

5 Upvotes

Having found imagemagick recently I’ve been playing around with various commands to give me what I needed, FYI - my primary goal was to take multiple screenshots and use montage to create a simple grid layout of them to go out in an email.. With my goal met, I’ve seen people create images from scratch which is amazing, and I’ve looked at loads of example commands on the IM website, but would love to see and learn from any real-world examples. So if anyone would like to share please do..


r/imagemagick • • Aug 11 '21

running the fotokilof GUI

5 Upvotes

Hi,

I've been trying to install a gui for imagemagick called fotokilof - are you guys familiar with it ?

https://github.com/TeaM-TL/FotoKilof

I downloaded the binaries in Github, I also tried the PyPI method advised by the creator. The 3 packages fotokilof 3.7.3, pillow and tkcolorpicker are installed but I have no idea where to go from there. There is no explanation of the creator. Just run it.

I found a fotokilof exe in Python but it doesnt seem to do anything.

Any insights ?


r/imagemagick • • Apr 12 '24

Install imagemagick on Apple Silicon macOS without Homebrew

4 Upvotes

Super-quick guide for those interested:

  1. Download the imagemagick x86_64 macOS binary release

  2. Copy the files from the archive bin and lib to /usr/local/bin and /usr/local/lib respectively (or your preferred bin and lib paths)

  3. Make sure Rosetta 2 is installed: /usr/sbin/softwareupdate --install-rosetta --agree-to-license

  4. Make sure XQuartz is installed

  5. Execute magick and allow executing the app on Privacy & Security on System Settings

There you go, Imagemagick on Apple Silicon without Homebrew.


r/imagemagick • • Mar 23 '23

A live-rendered youtube subscriber count

4 Upvotes

r/imagemagick • • Oct 18 '16

How do they make these portraits?

Thumbnail
ibm.com
4 Upvotes

r/imagemagick • • Jul 04 '16

How to crop an image into overlapping tiles, feather edges on each, and reassemble with same overlap but now larger pieces? (Please see text & discuss)

4 Upvotes

tldr: So the steps we need from imagemagick are:

1. Crop/Split an image using an overlapping system or grid so we end up with 9 or 12 pieces (these twelve images will be uprezzed in with an inbetween step using deep dream)

2. Feather each of the result images edges

3. Assemble the grid of now larger images with the proportional overlapping edges making use of the feathered alpha from the previous step (to blend the grid result minimizing a grid look.)

Here is the idea in a nutshell. We are trying to "dream" a deep style painting and then enlarge the image using cropped tiles and more dreaming/processing. So we'd need to crop the initial result into overlapping segments, process/dream the segmented image to gain more detail and then reassemble the now larger pieces into an overlapping grid WITH feathered edges. (The overlap and feather are necessary to avoid a grid effect in the final output) See bottom links for visual example of what I'm talking about.

Here are some resources I found on the topic. The first link here looks especially useful but I don't even know how to call the script. (I downloaded it, but fail to understand its usage in practice I need an example of where to place the usage code or how to call the script. If anybody feels like helping with even just this step I'd really appreciate it)

Cropping split with overlap: http://www.fmwconcepts.com/imagemagick/overlapcrop/index.php http://imagemagick.org/discourse-server/viewtopic.php?t=22942

Feathered edges: http://www.imagemagick.org/Usage/thumbnails/#soft_edges

Montage image compilation: http://www.imagemagick.org/Usage/montage/#overlap

For even further explanation here at the bottom are some example steps of the same process but setup in Indesign if it helps illustrate what I'm trying to achieve.

Step 1. Dream a neural-style result image

Step 2. In Adobe InDesign setup an overlapping grid and then paste the result image into each box.

Step 3. Set the document size to match your grid box size and make multiple pages for each box

Step 4. Output each of the pages as their own jpeg image using the export function.

Step 5. Dream each of the 12 images using the original style image. Best to setup a loop so you don't have to wait around running each one.

Step 6. Use the grid from step 2 and create a new document the exact size of the whole grid. Drag each of your new result images into each step of the grid and fit photo size to box.

Step 7. Use Gradient and Basic feather effects to blend the tile edges together

Step 8. Output final result image. Note - Since my Indesign document was setup at the size of the original result the final image resolution doesn't match the available resolution since each box now contains a higher resolution than the original 72dpi. To compensate I just up the resolution within the output settings and you gain detail in the final output.

I will be sure to credit you when I share on reddit and github.


r/imagemagick • • Dec 26 '15

Rendering A Horribly Massive SVG File

4 Upvotes

I have this absolutely disgustingly large SVG file. When I say disgusting, I mean it's 220k lines of shapes (it's a directional graph). Chrome has issues rendering it. Inkscape can't consider it as it's a 32-bit program. RSVG nopes out and says the input is too large. ImageMagick is my only hope.

I've successfully rendered some things out of this. But it's all crunched up in the corner. I don't know how to uncompress it. I've tried the size and density options but I'm not sure what else to try.

Has anyone done this before? I've included the first few lines of the file below so you can see the weird dimensioning. I don't know if I'm posting this in the right sub but I'm hoping someone can shed some light on this. Assume RAM is unlimited.

<svg width="8pt" height="8pt" viewBox="0.00 0.00 8.00 8.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 4)">
<title>%3</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-4 4,-4 4,4 -4,4"/>
<g id="node1" class="node"><title>0ad</title>
<ellipse fill="none" stroke="black" cx="0" cy="-0" rx="27" ry="18"/>
<text text-anchor="middle" x="0" y="3.7" font-family="Times,serif" font-size="14.00">0ad</text>

r/imagemagick • • May 22 '26

Distort and crop texture from a picture?

3 Upvotes

I'm trying to do a simple mock up of my dad's new apartment. I have a photo of a wall of the new place. I'd like to distort and crop (and anything else?) to make a texture i can load into Blender. Here's my attempt:

magick wall-picture.jpg -alpha set -virtual-pixel transparent -distort Perspective '1408,284 0,0 1421,1038 0,1023 2035,1223 1023,1023 1970,173 1023,0' -crop 1024x1024 Blender/left-ctr-texture.png

The original image is 2560x1920.

I want to make the output file 1024x1024 (though I suspect i might increase that). I want pixel 1408,284 from the original image to be at pixel 0,0 in the output image. Similarly:

  • 1421,1038 goes to 0,1023

  • 2035,1223 goes to 1023,1023

  • 1970,173 goes to 1023,0

However, magick seems to do the perspective change into an image that is the same size as the original and then crops that to 1024x768.

  1. how do I tell magick that i want the perspective operation to generate a 1024x1024 result size?

  2. how do I get magick to distort the source coordinates to the specified destination coordinates? (e.g., the last control point pair ends up off the image)

becomes

Edit: I'm trying to capture the part of the image around the window: between the adjacent far left wall and the left edge of the bump-out to the right of the window, and from the floor to the top of the crown moulding.


r/imagemagick • • Mar 12 '26

Need help, and I think imagemagick can help. See body text below

Thumbnail
gallery
3 Upvotes

I am on windows 10. have some screenshots I took with nvidia overlay, and I guess because I'm running HDR, it saved the screenshots as .jxr files. If I open them with windows' "Photos" default app, they look perfect. If I "save as" within the photos app, they look blown out [SEE IMAGE 1]. However, I tried running the magick command magick mogrify -format png -colorspace RGB -sigmoidal-contrast 5x50% -depth 16 *.jxr to convert them all to PNGs (or JPGs, I tried that too), they look massively oversaturated [SEE IMAGE 2]. Can y'all help me out with the command? You may have to install jxrlib for magick to work on jxrs, I used conda install main::jxrlib


r/imagemagick • • Mar 09 '26

ImageMagick 7 build script for Debian/Ubuntu with source-built delegates

3 Upvotes

Hi all,

I put together a build script for Debian/Ubuntu that installs ImageMagick 7 and builds its dependencies from source in a dedicated workspace.

It’s meant for cases where distro packages are outdated or missing delegates/features. The script currently supports Debian 12/13 and Ubuntu 20.04/22.04/24.04, and it now also lets you set the parallel build count manually with --workers / -w.

A few details:

  • builds ImageMagick and most delegate libraries from source

  • prefers the highest installed stable gcc/g++ pair starting at version 11

  • keeps pkg-config lookup deterministic

  • supports manual worker counts for faster builds on larger machines

  • includes helper logic for fonts and common dependency setup

GitHub Repo

Example:

git clone https://github.com/slyfox1186/imagemagick-build-script.git
cd imagemagick-build-script/ || exit 1
bash build-magick.sh --help

If anyone here uses ImageMagick heavily on Debian or Ubuntu, I’d appreciate feedback on missing delegates, distro-specific issues, or anything that should be cleaned up further.


r/imagemagick • • Dec 29 '25

Generate actual image from Chafa output

Thumbnail
gallery
3 Upvotes

I'm trying to create wallpapers by piping chafa to imagemagick. The command is as follows:

chafa -f symbols -c 240 --dither bayer --color-space din99d --exact-size on ~/.config/omarchy/themes/omarchy-sidonia-theme/backgrounds/wallhaven-6o6orw.png | magick TEXT:- test.jpg

The final bit is the bit I added. Convert was deprecated and replaced with magick so I replaced that and the other bit is from Stack Overflow. The expectation is that I get an image like the first one but unfortunately the second image is what I get. It makes sense because in essence I'm telling image magick to convert the text to an image- I'm missing something.

When I try to change the TEXT to something else, it tells me that * is either not a delegate, or doesn't support the type. Also makes sense.

What I'm trying to find out is, is this even the right way? If yes, what delegate would support what I need? Imagemagick states that the following are installed:

Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype heic jbig jng jp2 jpeg jxl lcms lqr ltdl lzma openexr pangocairo png raqm raw rsvg tiff uhdr webp wmf x xml zip zlib zstd

Can anyone help me make sense of this?


r/imagemagick • • Nov 15 '25

Transparency Mystery

3 Upvotes

I have a lot of images I need to stitch together, but they have instrumentation data on them; the same place in each image. I use Gimp to create a mask, then use convert to apply the mask to all of the images. For example to apply mask.png to image1.png:

convert image1.png \( mask.png -alpha extract \) -alpha off -compose copy_opacity -composite "${f/%.png/-m.png}"

The mask is black and transparent only, the transparent area is where the instrumentation is. This works fine, as far as I can tell. The masked images are transparent where the instrumentation was.

Next I stitch them using python & OpenCV. I read all of the masked images in, then execute

stitcher = cv2.Stitcher.create(cv2.Stitcher_PANORAMA)

status, pano = stitcher.stitch(imgs)

This stitches them together. Now for the mystery: The images get stitched, but the instrumentation is there! The instrumentation is emphatically **not** in the masked images! I have even moved the original images out of the directory and somehow, the stitching of the masked images still brings in the parts that were masked!

I've checked the masked images in Gimp and they don't have extra layers.

If I open the masked images in Gimp, then immediately overwrite them, only the first image has the masked parts, but the rest of the images **are** masked and stitched properly.

If I open each masked image in Gimp and Export as..., give them a new name (compress 3, save background color), then stitch those - The stitching works perfectly.

I am trying to figure out what is going on and I need to run this all using ImageMagic not involving a Gimp step.

ideas?


r/imagemagick • • Aug 30 '25

Script to batch apply alpha mask .pngs to correspondingly-named .pngs in the same directory?

Post image
3 Upvotes

Hello, how would I go about running this process with many pairs of images with matching filenames as in the example image?


r/imagemagick • • Jun 02 '25

New to IM; want to make 500 numbered images for YT thumbnails

3 Upvotes

Hi all,

I recently finally ditched PS, wherein I used Variable Data Sets to accomplish this from Episode 001 to 500.

Based on search results, several threads in r/GIMP have stated IM can also do a form of this but I have 0 idea how to do it.

Can anyone please help?

Thanks in advance!