9,137 questions
Best practices
0
votes
1
replies
22
views
Best way to generate a noisy image with ImageMagick?
What's the best way to generate a noisy image with ImageMagick?
I'd like to create an image where the color-frequency distribution is even (white noise) or skewed toward lower frequency colors (brown ...
0
votes
0
answers
45
views
MiniMagick/ImageMagick produces Grayscale PDFs(contains colourful images) inside Docker, but Color PDFs Locally (Rails 8)
The Problem Statement
My Rails 8 application uses MiniMagick to composite multiple color JPEG/PNG images onto a single blank page, draw bounding boxes, and output the result as a PDF.
When running the ...
1
vote
3
answers
61
views
How to replace white with transparent including gradients?
I want to convert the white background to a transparent background in an image like this
the sunburst rays need to fade out too!
Naive commands like -transparent white (regardless of -fuzz amount) ...
0
votes
1
answer
152
views
Why do Images leave giant piles of RAM behind them? [closed]
I am currently working on a .NET 9 WinForms program that contains an ImageViewer, which is a seperate window where you can scroll through a series of images.
My problem is that even after closing the ...
-1
votes
2
answers
182
views
How to find printed document in image
Image contains single document printed in white paper. Background of image can be different.
Tried to get document using code from https://scanbot.io/techblog/document-edge-detection-with-opencv/ with ...
-1
votes
1
answer
142
views
How to remove non uniform background from image [closed]
Receipt clip contains structured background:
Tried to remove it using textcleaner ImageMagic wrapper script from Remove receipt image border using ImageMagick answer.
Used code from answer How to use ...
1
vote
1
answer
139
views
Magick++ can't identify format of file
I'm currently trying to implement an IThumbnailProvider to render a thumbnail for PSD files on the explorer. I plan to use ImageMagick and it's C++ API (Magick++) to do so, as I've used this lib ...
-4
votes
1
answer
104
views
How to force ImageMagick to not destroy file contents by overwrites? [closed]
How to make sure ImageMagic never overwrites files? To avoid this type of situation:
name1=$(identify -format '%[EXIF:DateTime]' input1.jpg)
magick -options... input1.jpg name1.jpg
# concurrently ...
5
votes
1
answer
148
views
Rotate an image with transparent background
I have trouble rotating images with transparent background while retaining a transparent background. magick::image_rotate() adds a white background with a gray border (I think due to anti-aliasing).
...
3
votes
1
answer
281
views
Python Wand: MagickReadImage returns false, but did not raise ImageMagick exception
I've got some long-standing code in a Django code base that reads in a PDF and uses Wand to take a screenshot of the first page of the PDF, which is then displayed on the website. We recently migrated ...
1
vote
1
answer
48
views
Combining two ImageMagick commands for dynamic masking [closed]
I want to combine these two ImageMagick commands, the first one creates a greyscale mask by drawing and combining two gradients, then, combines the merged gradients with the extracted alpha channel ...
0
votes
1
answer
107
views
resizing SVG makes it jagged and not smooth with magick
I have a SVG (in.svg) which I want to resize to 1200x1200 :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
x="0px&...
-1
votes
1
answer
158
views
How to add a rounded white edge to a rectangular image? [closed]
I have the input image shown below. I'm trying to add around it a rounded edge.
I've tried with the command below and adds a border but without rounded corners
convert input.jpg -shave 1x1 -...
0
votes
2
answers
58
views
How to overlay transparent shape with contour? [closed]
I have these 2 input images shown below. img1.png has a car in black and the rest transparent.
img1.png
background.png
I and like to fill img1.png with the background.png image to get this output, ...
0
votes
0
answers
60
views
Fastest way to create a palettized image in Magick.NET?
I'm trying to use Magick.NET to save palettized images generated by my program. Currently I'm using the following process:
Create the image with MagickImage img = new(MagickColors.Green, (uint)Width, ...
-1
votes
1
answer
48
views
When converting a PSD to a PNG, the black border shadow disappears using ImageMagick [closed]
When converting a PSD to a PNG, the black border shadow disappears using ImageMagick
Original Image:
After converting losing black border shadow using imageMagick:
When converting a PSD to a PNG, the ...
1
vote
1
answer
145
views
Splitting a PDF into a list of images iText7 and ImageMagick
I have code where I'm trying to split PDFs into a list of jpg MemoryStream files. I the split portion working, where it takes around under a second or less and creates 100 pdf streams. However once I ...
1
vote
0
answers
69
views
Performance Regression with Imagick between PHP 7.2 and 8.2
I'm noticing a significant performance difference when running the same Imagick script on PHP 7.2 versus PHP 8.2. Here are the results I’ve gathered:
PHP 7.2, ImageMagick 7.0.7, Imagick 3.44: 3.8 ...
0
votes
0
answers
76
views
Does ImageMagick support drawing vectorized primitives and saving to postscript?
I've tried playing with Magick++ and drawing few simple primitives:
Magick::InitializeMagick(nullptr);
Image image(Geometry(1900,1200), Color("white"));
image.strokeColor("red");
...
0
votes
1
answer
164
views
Convert PDF to TIFF using GhostScript + ImageMagick - 300 DPI, 8-Bit Depth
I am converting a PDF to a Tiff File using GhostScript and ImageMagick in a C# winform app, but I am not getting the correct settings in the result.
DPI is set to 300 with GhostScript, and 8-Bit Depth ...
0
votes
1
answer
122
views
Golang ImageMagick Leftover Threads
I have written a linux service in Go that processes a large number of image files, converting them from TIFF to JPEG and adding a text overlay on top. I'm using the Go package gographics/imagick/v3 ...
0
votes
0
answers
96
views
im4java throws Exception convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/581
I tried to use ImageMagick/im4java in my Kotlin project, but it always throws an exception like this.
org.im4java.core.CommandException: convert-im6.q16:
no decode delegate for this image format `' @ ...
0
votes
0
answers
107
views
Imagick "Unable to set image alpha channel" error when turning PDF into JPG
First of all, this all involves older versions of both PHP and Imagick, that we cannot update at the moment due to technical constraints.
In our project we preview PDF contents to users by splitting ...
1
vote
0
answers
25
views
ImageMagick Convert Pipe not working in Node
My main goal is to convert an SVG tag to PNG using Node.js and ImageMagick. I am also caching data to a Transform stream that writes to a file. I have the SVG tag ready, and when I either console.log ...
1
vote
1
answer
83
views
When extracting pages from PDF, Imagemagick improves images but blurs text, PDFtoppm retains crisp text but also dark images
I want to extract all pages from this PDF file, improve their color levels, and eventually OCR them.
I've used Imagemagick:
magick Historia_de_CA_vol1_Cap1_0.pdf mogrify -auto-level ...
-1
votes
1
answer
53
views
adding watermark when processing several images in batch?
I'm adding several images to one pdf using imagemagick, and currently i'm duplicating all images in another directory just to add a watermark on them.
Is there a way to do this in one pass?
one ...
0
votes
1
answer
84
views
Infinite loop behavior from imagemagick when called from a shell script
I want to post-process pdf documents using imagemagic. I compile the documents themselves through Tex, using Lualatex. After compilation, a script I wrote automatically comes into play, which performs ...
-1
votes
1
answer
53
views
Colorize Specific Regions of an Image Using a Mask with ImageMagick
I'm trying to colorize specific regions of an image based on a mask using ImageMagick. The mask contains white pixels where the image should be colorized and black pixels where no colorization should ...
1
vote
1
answer
140
views
Why does ImageMagick setImageCompressQuality 0 result in a larger file size than 1?
I'm converting PNG images to WebP and trying to do maximum compression with ImageMagick.
My PHP code to run ImageMagick looks like this:
$imagick = new Imagick($filePath);
// Set WebP format and ...
1
vote
0
answers
55
views
Why am I getting 'Failed to decode QR code: An error occurred while processing some image(s)' in PHP with ImageMagick?
I am working on a PHP application that involves decoding QR codes using ImageMagick. However, I encountered the following error in my logs:
{"logtime":"2024-12-04 14:19:45.955",&...
0
votes
1
answer
74
views
Imagemagick different colors with same hex code
I'm trying to match colors manipulated with ImageMagick to those generated by LaTeX. The following is a screenshot of Imagemagick's help pages (at https://imagemagick.org/script/color.php). It strikes ...
-1
votes
1
answer
80
views
Normalize the hue of all images at once from a reference image [closed]
I've got several images of characters from A-Z and 0-9 that have been generated with an artificial intelligence program and the problem is that all these characters don't have exactly the same hue ...
1
vote
1
answer
202
views
Extracting the least significant bit in a very large TIFF/JPEG image using open source library
I want to extract the least significant bit (LSB) of each pixel in a very big image (19,566x14,321) that is in TIFF format.
An example of such an image is here: Carina Nebula
This is in JPG format, ...
0
votes
1
answer
121
views
Use Imagemagick to dump the pixels of a grayscale image
I have a sample grayscale file z-gray-1x3.png, consisting of a single row of three pixels with grayscale values 0x00, 0x7f, 0xff:
I tried to write a script using imagemagick, hexdump, sed and tr but ...
1
vote
1
answer
681
views
no decode delegate for this image format `JPEG'
I am using Alpine to build a docker container. After recent updates I get the error message:
no decode delegate for this image format `JPEG'
When I list the supported formats JPEG seems to miss:
$ ...
1
vote
1
answer
409
views
Get bytes from MagickImage image
Is there a straight forward way to get the bytes from a MagickImage?
That is, like writing it to a file but, instead, writing it to a byte array.
0
votes
1
answer
69
views
Erasing solid color background from behind a transparent object
I would like to erase solid color background from a picture like this:
Representation of result as it would appear in graphics editing software:
Is there a straight forward way to do this in Magick....
0
votes
0
answers
85
views
Can't Render Emojis Using MiniMagick in Ruby on Rails
Could you please help me with generating images that include emojis?
Currently, I'm failing to load the font and getting the following error:
MiniMagick::Error in HomeController#index
`mogrify -...
-2
votes
2
answers
107
views
How do I reduce a specific colour range to a single colour? [closed]
I'm using -kmeans to reduce some images from true RGB to 256 colours, for use in Unreal Engine 1. In order to have transparency in those textures, I need to use a magenta mask colour (#ff00ff).
The ...
0
votes
0
answers
123
views
Trying to format imagemagick pango: markup
I have tried these two approaches below with no luck. If I change the first command line and replace pango: with caption: it works, but prints the html markup in the text. When I use pango: it simply ...
2
votes
3
answers
347
views
Unable to install Perl module Image::Magick on Windows OS (Strawberry Perl)
I am using Strawbery Perl and trying to apply the image::Magick package on Windows 11 OS but keep getting errors:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools>cpanm
--force Image:...
-1
votes
1
answer
74
views
How to apply brightness to a rectangular region with a feather
I need to batch process image files and know nothing about ImageMagick, but it is installed on my mac and I can use it. I have over 60 png files that are 256x256 pixels in size that I wish to ...
-1
votes
1
answer
50
views
Imagemagick composite of two images results in unexpected 90º rotation of second image
this command using the first two attached images results in the third image. how is the rotation of gotg021.jpg happening?
magick composite -blend 50 gotg021.jpg gotg01150.jpg -alpha Set transition1-...
1
vote
2
answers
376
views
How to generate random color pixel fill in imagemagick within specified limits? [closed]
there!
Task. I want to change the color stripes on the Commodore64 logo. So that they consist of squares in 4 rows, slightly different in color from each other. But only slightly different. Within the ...
-2
votes
1
answer
66
views
I want to dynamically compute position of text using Imagemagick -annotate {X,Y} with -gravity , but I need an explanation of the X value
I can force text into the proper position using actual numeric values for X and Y in -annotate +X+Y, but I want to be able to compute the X and Y values (in my program) relative to the image size. I ...
-1
votes
2
answers
198
views
How can I replace one single pixel in a picture with a defined color?
I want to replace a single pixel in an image with a defined color, with the option, to set lines.
Example:
pixel 0,0 should be replaced with srgb(85,85,85).
Next step: pixel 0 to xxx should be ...
0
votes
3
answers
526
views
Trim with padding in imagemagick
How can I trim whitespace from an image but keep some padding with imagemagick?
I tried the -trim option but imagemagick crops down to the very edge of the content without leaving any padding.
Note, I ...
0
votes
2
answers
143
views
ImageMagick: Combine multiple static static gifs with a randomly placed animated gif and preserve the animation
I have many groups of gif images and in each group one of the images is an animated gif. I'm using ImageMagick 6.9.10-23 Q16 x86_6 on Ubuntu 20.04 with PHP 8.2.12.
For each group I want to take the ...
1
vote
0
answers
82
views
Minor ImageMagick upgrade on Ubuntu Causes Magick::ImageMagickError in Ruby
After a recent security update to ImageMagick on our Ubuntu server, we started encountering an issue with our Ruby code. We upgraded the ImageMagick package from version 8:6.9.11.60+dfsg-1.3ubuntu0.22....
0
votes
1
answer
120
views
Can a LZW implementation be correct yet not optimal?
I am used to compressing my TIFF images to gain storage space. This compression is internal - I use the excellent ImageMagick CLI tool with the -compress lzw flags to have the image data be compressed ...