brew install imagemagick
apt-get install imagemagick
- You need to escape where necessary. IE if you have a command
convert max-width.jpg -resize 200\> max-width-resized.jpg
You need to escape the > character.
The advantage of identify, is that you can also feed it without extensions. This function will allow you to quickly determine the image type, dimensions and how color is managed.
identify file
To customize the output use -print
identify -format "Name: %f Type: %P Dimensions: %m" filename
convert puppy.jpg -resize 80% resized.puppy.jpg
Create batch folder - mkdir ./resize/batch
convert *.jpg -resize 80% -set filename:f '%t@2x' '%[filename:f].jpg'
Add set for filename by adding :f at the end filename:f
Add %t followed by @2x to represent a retina image.
Meta data takes up image file size space, it should be removed.
- Make sure to have extra copies of original image.
- Start with retina image and optimize it and append @2x.
- Use mogrify to reduce file size for non-retina. Example
mogrify !(*@2x).jpg -resize 40%
- Quality reduction
- Progressive (comprobed compression)
- Possible need for small blur if required.
- Strip meta data.
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% source.jpg result.jpg