Questions tagged [imagemagick]
ImageMagick is an open source software suite for displaying, converting and editing raster image files.
479
questions
0
votes
2
answers
48
views
Can ImageMagick make my grayscale image brighter by "compressing" the black-to-white range to dark-gray-to-white?
I have a grayscale image with pixels ranging from black to white. I'd like to make it brighter by moving the "black floor" up, and scaling the other pixel intensities. I'd prefer linear ...
0
votes
1
answer
95
views
How to composite images with offsets and scaling into a single image?
I would like to use imagemagick to create a mosaic.
I have a list of images along with their individual offsets and scales, for example:
a.jpg, translate to 0,0 and scale to 100%
b.jpg, translate to ...
1
vote
1
answer
59
views
How can I allow ImageMagick to convert a grayscale png to an ico file without errors?
I have a grayscale PNG, and when trying to use ImageMagick (Version 7.1.1-28) to create an ICO file it always gives me the following warning:
$ convert favicon.png -define icon:auto-resize=16,32,48,64,...
29
votes
2
answers
26k
views
Command line to automatically crop an image?
By using Gimp's menu, you can automatically crop the image (removing white borders). I have a lot of images with white borders of different sizes. I want to remove them using Gimp in command line but ...
0
votes
2
answers
147
views
Why is this PNG converting to black JPG in imagemagick?
I swear this image was properly converting to a white-background JPG with black line art. Here is the original PNG (in case SE changes it when you upload). Here is what it looks like:
But this is the ...
1
vote
1
answer
298
views
How to convert Samsung's motion photos to still photos?
I've taken a bunch of photos on my Samsung Galaxy phone after inadvertently activating the "motion photo" mode, which captures a short video clip before and after the "click", ...
8
votes
4
answers
6k
views
How to convert DICOM images to PNG?
I have some DICOM medical imaging files downloaded from Cancer Imaging Archive. I can convert them from DICOM to several other formats, but as you'll see the conversion isn't working as expected in ...
2
votes
2
answers
103
views
How to prevent large file size in JPEG-PDF roundtrip conversion?
TL;DR: File size doubled in roundtrip conversion between JPEG and PDF. Tools used : poppler and imagemagick
I am doing this
Extract images from a pdf containing only images (scanned document), via ...
1
vote
3
answers
2k
views
How can I find invalid images?
I have a directory with sub-directories. In the directories, there are a lot of images, crawled from the web.
How do I loop through every file and show those files which are not valid image files?
...
0
votes
0
answers
125
views
How to fix error unable to read font in ImageMagick/Debian?
I'm running ImageMagick in WSL Debian and Ubuntu. I'm trying to write some text with ImageMagick but I getting font errors in both WSL linux versions:
$ magick -background lightblue -fill blue -font ...
0
votes
1
answer
232
views
Converting WebP files to GIF doesn’t work as expected. Resulting GIF is glitchy
I run command to convert WEBP into GIF but it's a bit "glitchy". Do I miss something?
Debian: 11.8
ImageMagick: 6.9.11-60 Q16 x86_64 2021-01-25
convert -delay 10 sample.webp -loop 0 -...
3
votes
1
answer
49
views
Is there an equivalent for ImageMagick’s “-shear” command in FFmpeg?
FWIW, I must run this on Windows platform.
I have a series of videos shot in identical conditions (mounted camera shooting trains), all exhibiting the same rolling shutter effect when train passes. ...
3
votes
2
answers
2k
views
How to identify black and white images in folder of images
I would like to identify the black and white images in a folder containing 300,000 images which are a variety of colours. An alternative method would be to identify the colour images and treat the ...
0
votes
2
answers
78
views
Some image files are deleted during output/moving with batch file
I've been having an issue for a while now with various versions of a batch file script I have been using to assist with listing items on my WordPress/woocommerce page. The script seems to occasionally ...
9
votes
2
answers
5k
views
How can I convert animated gif to animated webp?
On ubunt, I can convert animated .gif files to .webp format using imagemagick's convert 1.gif 1.webp, but then the animation is lost in the destination .web.
I'm wondering how to preserver the ...
1
vote
1
answer
255
views
Preserving transparent colors when converting svg to png
I have an SVG file that contains transparent colors like "#FF000080".
When I convert the SVG to PNG using ImageMagick, the transparent colors are converted to black. (Any colors without an ...
4
votes
1
answer
217
views
Replacing a color using -transparency regardless of existing pixel opacity, using ImageMagick
I have a colorful image that has alot of existing transparent background, but also a few blocks of hot pink rgb(255,0,255) color I want to additionally become transparent.
I'm doing so like this:
...
88
votes
3
answers
57k
views
Invert colors with ImageMagick
How do I invert the colors of an image using the ImageMagick convert tool, so that black becomes white and white becomes black?
In other words, I want to turn this:
into this:
2
votes
1
answer
229
views
Make a GIF image with an exact given byte size
For a specific task (replace an image inside a firmware without any data offset shifting), I need to create a GIF file of size 409x240 pixels of exactly 6449 bytes:
offset 0-5: GIF89a (magic string)
....
2
votes
1
answer
258
views
Best ImageMagick parameters to upscale image containing text
What are the best ImageMagick parameters to upscale an image that contains text in Latin alphabet?
Take this image as example:
I did some experimenting, for example:
magick convert in.png -filter ...
1
vote
0
answers
52
views
Is it possible to separately run image magick commands on certain pages in a pdf documents, then combine it all into one pdf?
I'm a student and have exams coming up. I'm trying to remove solutions from some online resources I've found to study from. The solutions were all written in red text under Short Answer (SA) questions ...
0
votes
2
answers
134
views
Merging a folder of 34,000 images in Photoshop
I have a folder of 34,000 images (all the exact same size) and I would like to layer them all on top of each other, doing something equivalent to Photoshop's "Darker Color" layer blending ...
0
votes
1
answer
318
views
ICO of 32-bit images
Requirement
I'm using this shell script to create an ICO file to fulfill this requirement:
Icons should be Windows .ico files and contain 32-bit images in the following sizes: 16, 24, 32, 48, and 256....
0
votes
0
answers
31
views
ffmpeg Is not compitable with minikube
I have one pod in minikube which is for video editing task and I am using the moviepy library. There is issue occurring Failed to read file duration and I debug the deep down code and found the cause ...
9
votes
4
answers
2k
views
How to resize an animated webp?
I want to be able to change the size of a dynamic webp.
Sample picture. I found this website to do just that.
So how can I implement something similar in my own program?
I tried using ImageMagick7 or ...
9
votes
4
answers
14k
views
Merge two pdf files side by side in command line
I have got two pdf files with same number of pages and want compare each page with the corresponding page in the other file. For this I would like to merge say page 1 of File1.pdf with page 1 of File2....
18
votes
3
answers
7k
views
Convert grayscale image into alpha channel image in unix shell
I have a gray-scale image. I want to convert it into an transparent PNG, such that the black pixels (in the original image) become fully opaque, the white pixels become fully transparent, a 50% grey ...
1
vote
1
answer
98
views
Is it possible to input a HSB color value and get its corresponding HEX color code as an output?
Let's say I have a colour in HSB format 120,100,100 and I would like to get its corresponding HEX code, which is 00FF00.
Is it possible to achieve this with ImageMagick?
Perhaps Something like:
Magick ...
19
votes
3
answers
78k
views
Command Line loop to run command on all files in a directory (plus sub directories, if possible
I'm assuming this is fairly easy to do, but I have zero experience with Windows's command line utilities. Basically, I need to iterate over all files in a directory (great if it can do sub-directories,...
1
vote
3
answers
3k
views
Converting png to pdf with imagemagick: how to set the resolution?
I have an image foo.png which is 1240 * 1754 pixels.
Using imagemagick on OS X, I convert this to a .pdf and specify the resolution to be 150 dots per inch, so its physical format will be exactly an ...
11
votes
4
answers
9k
views
ImageMagick Convert: How to produce sharp resized PNG files from SVG files?
I am using this command to generate a sharp 512px wide version of an SVG file that I have:
convert -geometry 256 pinterest.svg pinterest.png
This is the source file:
<?xml version="1.0" encoding=...
23
votes
3
answers
11k
views
Error in converting a PDF to a PNG in ImageMagick
I use Imagemagick convert to convert pdf file to png as follows:
Magick convert -density 300 PointOnLine.pdf -quality 90 PointOnLine.png
It gives warning:
convert: profile 'icc': 'RGB ': RGB color ...
7
votes
3
answers
9k
views
mogrify - how do you recurse through subfolders in Windows
I thought there was a simple switch in mogrify command options that tells it go through subfolders as well. I didn't find any. On Linux, the "find" command seems to do the trick, how do you do this on ...
8
votes
1
answer
906
views
How to create PocketBook-compatible BMP files using ImageMagick?
PocketBook 611 is a black-and-white e-book reader. PocketBook 611 (and models of similar age, before touch displays were introduced) uses a very specific BMP format for its so-called "Power-off ...
2
votes
0
answers
268
views
How to process images of documents to look like a scan?
Assume that I have photos of several text documents and presentation slides captured using my smartphone camera. Due to uneven lighting, these photos have color and brightness gradients. Also, the ...
0
votes
0
answers
337
views
What can I do to fix ImageMagick in Catalina?
I tried to check installations of ImageMagick then brew. In a classic case of knowing just enough to cause trouble the diagnoses are more complicated than I know how to treat. Hoping for a second ...
30
votes
4
answers
44k
views
How to convert a photo to a black and white image by ImageMagick?
How can I convert a JPEG photo to black and white (not grayscale) image like output of a FAX scanner, by ImageMagick?
55
votes
5
answers
74k
views
I want to change DPI with ImageMagick without changing the actual byte-size of the image data
In GIMP there is a very simple way to do what I want. I only have the German dialog installed but I’ll try to translate it. I’m talking about going to Picture -> PrintingSize and then adjusting the ...
3
votes
1
answer
6k
views
How do I print an image to a fixed size over multiple pages?
I want to print an image that is 52x44 cm using letter sized pages in Windows 10. So it's similar to this question, but I need to print an image that is larger than one page. Presumably it will take ...
3
votes
1
answer
4k
views
exiftool width and height of resized images not match the new sizes
$ convert original.jpg -resize 50% test.jpg
$ exiftool test.jpg
...
Exif Image Width : 1200
Exif Image Height : 1600
Image Width : 600
Image Height ...
0
votes
1
answer
151
views
is JPEG artifact in any case unavoidable when increasing image size?
When I increase the image size to 200% or higher , the JPEG artifacts (ugly dots around sharp edges) are clearly visible. Same goes for PDF files that are lossily compressed.
Are there no compression ...
0
votes
0
answers
188
views
Rotate images with biggest side (image width) to be the vertical side
Rotate images with biggest side (image width) to be the vertical side
You can see the problem here:
Imagemagic / gimp and other tools fails to orient photos concisely.
I am searching for a tool that ...
0
votes
1
answer
344
views
How do I batch-convert files from an input list using ImageMagick 'convert'?
I'd like to use ImageMagick's convert command to convert a batch files from GIF to PNG format.
I'm using Ubuntu 22.04. I have a file gif-list containing the names of files in GIF format, one per line ...
2
votes
1
answer
807
views
ImageMagick Mogrify Compress Images Recursively
Windows 10. ImageMagick v7.1.0-62
I need to compress and optimise a lot of .jpg images using ImageMagick. I am using the following command, which is working (this overwrites the original files which ...
1
vote
4
answers
3k
views
Sorting files in an numerical order
I have multiple tiff images ordered from 1 to 246. I converted them to a PDF file using imagemagick with convert *.tif out.pdf. However the order of the pages inside the pdf file differs; (for ...
1
vote
1
answer
10k
views
TCPDF ERROR: TCPDF requires the Imagick or GD extension to handle PNG images with alpha channel
I deployed my app and there's a feature to show the document as pdf, but I got this error message:
TCPDF ERROR: TCPDF requires the Imagick or GD extension to handle PNG images with alpha channel.
...
1
vote
0
answers
113
views
adding labels/captions with imagemagick
I'm trying to make a script that will add the file name to a label under the images. I found out I can use ImageMagick on linux to do that, but I can't figure how to do it right.
The documentation ...
1
vote
1
answer
1k
views
imagemagick commandline resize to fixed width/height keeping scale
I am currently using PHP, but its resampling is not good enough for my needs.
Suppose I have an image 200x200. I need it resize to 100x50. Then I need it resized scaled down cleanly as possible (here ...
2
votes
2
answers
10k
views
Imagemagick convert returns "no decode delegate for this image format"
I am trying to use this command for ImageMagick:
convert "c:\users\****\My Documents\test.png" -transparent white test2.png
However, I keep on getting two errors that look like this:
convert.exe:...
1
vote
1
answer
914
views
How do I properly downscale an image from 300 dpi down to 72 dpi using imagemagick?
As the title says, I want to know the proper way to downscale my image that is originally 300 dpi down to 72 dpi while still maintaining the same quality of the image.
By quality, I don't mean the ...