---
title: "imagemagick"
tags: [ "Documentation", "Vision" ]
---
[Source](http://lxlinux.com/imagemagick.html)
Convert jpg to png.
```bash
convert image.jpg image.png
```
```bash
convert image.jpg -quality 50 image.jpg
```
'Quality' must be from 1 to 100.
```bash
convert -resize 50% image.jpg image2.jpg
```
Resizing only changes jpegs. Change a png with:
```bash
convert input.png png8:out.png
```
# Invert Colours
```bash
convert input.jpg output.jpg -negate
```
# Make Images Smaller
```bash
convert image.jpg -resize 25% output.jpg
```
# Trim images to border
This is generally used for transparrent images.
```bash
convert -trim image.png output.png
```
Make the white of an image transparrent.
```bash
convert -transparent white -fuzz 10% input.png output.png
```
The 'fuzz' option tells the computer that 'close to white' is fine. You might want to use 20% or higher fuzz.
## Dropshadow
```bash
`convert \( +clone -background black -shadow 50x8+0+5 \) +swap -background none -layers merge +repage