Convert format all images in imagemagick subfolders - imagemagick

I have a folder with pictures and subfolders I'm trying to reduce the size of the pictures in the subfolders and Lossless compression and convert them to jpg 2000
Which I used
find ./static/assets/images/* -name '*.png' | xargs mogrify -strip
It works fine, but I don't know how to change the image format.

Related

ImageMagick v7 conversion of 8bpp images

On Windows 10, I need to crop and resize whole folders of images.
Following the documentation and some answers here i've built this batch:
magick mogrify -path ./cropped -crop 1300x1940+85+130 +repage -resize "800x800^" *.jpg
It mostly works, but when a folder has mixed image formats (some are 24bpp, some are 8bpp, grayscale) this batch skips all the 8bpp ones.
How can i change my command so it accepts and modify every image, no matter what?
Note: i used mogrify as i understand it is needed to process a whole folder and save the result in another one, but i'm unsure it is necessary.

Lowering the image size is disturbing background image and color using minimagick and mogrify

I am using Mogrify in Ubuntu to scale my images to lower size that is working fine for most of the images.
Problem is my all PNG images are above 30MBs and if I try to scale them to 300kB it starts to disturbs the background colors and fade them off.
What I do is:
Convert png image to jpg using below command.
find . -iname '*.png' -exec mogrify -format jpg "*.png" {} +
At that point everything stay same and fine but size is still 30MBs
Then I do below command to give it low size but it disturbs colors of entire image.
find . -iname '*.png' -exec mogrify -define jpeg:extent=300kb -strip -quality 90 -scale 90% *.jpg {} +
How I can easily convert my images sizes to 30kBs or even 40kBs without disturbing the image colors.
My main goal is to preserve original colors. It does work but now its not!

Convert all jpg images to webp Magick

how can I convert almost all images from jpg format to webP format if they are already on the server?
I used the command
magick convert. * jpg .webp
but I don't think it's ok because it would create images over them. How should we proceed as correctly as possible so as not to duplicate the images?
Is there an easier way to do this since I have all the images on the server?

Image magick (windows) - How do I perform batch resizing for several images type in a folder?

How do I perform batch-resizing for many images in a folder?
for example I have 4 images in folder C:\tried
image1.jpeg
image2.png
image3.bmp
image4.tiff
and I want to
1. convert them to JPG
2. resize them to 575px
3. lower the quality of each image to 90%
4. move them into different folder
5. delete every picture that converted
Can I do this using batch file (*.bat) in Windows?
start from number 1,
There are plenty of examples on Stack Overflow:
magick mogrify -path OUTPUTDIRECTORY -format JPEG -resize 575 -quality 90 *.tif *.jpg *.bmp
You'll have to delete them yourself.

pink tif file made from ImageMagick

I am trying to send a tiff file through fax machine.
This file seems fine with image viewer and paint, but
my boss told me that while trying to send the tif file using fax program,
he's getting pink all over his background instead of white..
and 40 kb of tif file bumps up to 600kb while trying to send the tif file..
And I used ImageMagick converting from PDF to Tiff, and the command line I used was
"C:/Program Files/ImageMagick-7.0.3-Q16/convert.exe" -density 200 -resize 1728x2291 -monochrome -compress group4 D://fax_files/201612/20161208155410.pdf D://fax_files/201612/example/1.tif
the pink image is here..
Did I make any mistakes on using ImageMagick or are there any issues that cause the problem?
If you know any, please help me out..
Thank you in advance..
I believe that to fax a tiff, it has to be binary (black/white), not color and needs to be compressed with group 4 compression.
With PDF files you need to set the density and units before reading the input and all the other arguments afterwards.
So
convert -density XXX -unit YYY image.pdf -resize ZZZ -monochrome -compress group4 image.tif

Resources