Magicstick
Ah nice π you mean ImageMagick
(the “magick” command) — it’s like a Swiss-army knife for images. You can do a lot
more than just changing DPI!
Here are some powerful things you can try:
π§ Basic Operations
- Resize
image
- magick
input.jpg -resize 1024x768 output.jpg
(Scales to 1024×768 px)
- Convert
format
- magick
input.png output.jpg
(PNG → JPG, works with almost all formats)
- Crop
image
- magick
input.jpg -crop 800x600+100+50 output.jpg
(Crops to 800×600 starting 100px from left and 50px from
top)
- Rotate
image
- magick
input.jpg -rotate 90 output.jpg
π¨ Enhancements
- Adjust
brightness/contrast
- magick
input.jpg -brightness-contrast 20x10 output.jpg
- Sharpen
image
- magick
input.jpg -sharpen 0x1 output.jpg
- Blur
image
- magick
input.jpg -blur 0x5 output.jpg
πΌ️ Creative Stuff
- Add
text watermark
- magick
input.jpg -font Arial -pointsize 40 -fill white -gravity southeast
-annotate +10+10 "© MyName" output.jpg
- Make
collage (append images)
- magick
img1.jpg img2.jpg +append output.jpg
# side by side
- magick
img1.jpg img2.jpg -append output.jpg
# one below another
- Add
border
- magick
input.jpg -bordercolor black -border 10x10 output.jpg
- Convert
to grayscale
- magick
input.jpg -colorspace Gray output.jpg
π Batch Processing
- Resize
all JPGs in a folder
- magick
mogrify -resize 1024x768 *.jpg
- Convert
all PNGs to JPG
- magick
mogrify -format jpg *.png
π¨️ Print-related
- Set
DPI (for A4, 300 DPI)
- magick
input.jpg -units PixelsPerInch -density 300 output.jpg
- Export
PDF to images
- magick
file.pdf page_%03d.png
- Make
multipage PDF from images
- magick
*.jpg output.pdf
π ImageMagick is super
flexible — you can combine these operations into one command. For
example: resize → add border → watermark → save as PDF.
Would you like me to build you a ready-made cheat sheet
of the most useful magick commands (like a quick reference guide)?
Perfect π you want to go deeper
into ImageMagick (the magick tool). It’s insanely powerful — not just
for resizing or DPI, but also for artistic effects, automation, and format
conversions.
Here’s a list of more things you can do:
π Image Transformations
- Flip
horizontally / vertically
- magick input.jpg -flip
output.jpg # vertical
- magick input.jpg -flop
output.jpg # horizontal
- Skew
/ Shear
- magick input.jpg -shear
20x10 output.jpg
- Perspective
distortion
- magick input.jpg -distort
Perspective '0,0 0,0 100,0
200,50 0,100 50,200 100,100 250,250' output.jpg
π¨ Filters & Effects
- Sepia
tone
- magick input.jpg
-sepia-tone 80% output.jpg
- Oil
painting effect
- magick input.jpg -paint 4
output.jpg
- Charcoal
sketch
- magick input.jpg
-charcoal 2 output.jpg
- Emboss
- magick input.jpg -emboss
0x1 output.jpg
- Solarize
(photo negative effect)
- magick input.jpg
-solarize 50% output.jpg
π Image Analysis
- Get
image info (metadata, dimensions, colorspace, DPI, etc.)
- magick identify -verbose
input.jpg
- Count
unique colors
- magick input.jpg -format
"%k\n" info:
- Generate
histogram
- magick input.jpg -format
%c histogram:info: > colors.txt
πΌ️ Advanced Compositions
- Transparent
background (remove white/black)
- magick input.png -fuzz
10% -transparent white output.png
- Overlay
watermark image
- magick input.jpg watermark.png
-gravity southeast -composite output.jpg
- Add
shadow
- magick input.png \(
+clone -background black -shadow 80x3+5+5 \) +swap -background none
-layers merge +repage output.png
π Documents / Multi-page
- Convert
all pages of a PDF to PNG
- magick file.pdf
page_%03d.png
- Make
a multi-page PDF from images
- magick *.jpg output.pdf
- Extract
specific page from PDF
- magick file.pdf[2]
page3.png
π€ Automation Tricks
- Resize
all images in a folder
- magick
mogrify -resize 800x600 *.jpg
- Add
watermark to all images
- magick
mogrify -gravity southeast -pointsize 30 -draw "text 10,10 '©
MyBrand'" *.jpg
- Convert
all PNGs to JPG
- magick
mogrify -format jpg *.png
⚡ Fun Stuff
- Meme
text (Impact font with outline)
- magick
input.jpg -gravity north -stroke black -strokewidth 2 -annotate 0
"TOP TEXT" \
- -gravity south -stroke
black -strokewidth 2 -annotate 0 "BOTTOM TEXT" output.jpg
- GIF
from images
- magick
-delay 100 -loop 0 *.png animation.gif
- Turn
video into GIF (with ffmpeg + magick)
- ffmpeg
-i video.mp4 frames/frame_%03d.png
- magick
-delay 5 -loop 0 frames/*.png animation.gif
π ImageMagick is like a Photoshop
in the terminal — batch editing, automation, effects, PDF handling, GIF
making, even vector art.
Do you want me to make you a ready-to-use command pack
(like a mini cheat-sheet with the top 30 most useful magick commands for
everyday + creative use)?
Nice π You can use ImageMagick
to add watermarks (text or image) in different styles. Here’s a practical
guide:
π️ 1. Text Watermark
Bottom-right corner (common use)
magick input.jpg -gravity southeast -pointsize 40 -fill
white -annotate +20+20 "© MyName" output.jpg
- -gravity
southeast → bottom-right
- +20+20
→ padding from edge
- -pointsize
40 → font size
- -fill
white → text color
Center watermark (faded)
magick input.jpg -gravity center -pointsize 100 -fill
"rgba(255,255,255,0.3)" -annotate 0 "CONFIDENTIAL"
output.jpg
- rgba(255,255,255,0.3)
→ semi-transparent white
- -gravity
center → placed in the middle
πΌ️ 2. Image Watermark (Logo)
Bottom-right logo
magick input.jpg logo.png -gravity southeast -geometry
+20+20 -composite output.jpg
- logo.png
= watermark image
- -geometry
+20+20 = offset from corner
Center logo (transparent overlay)
magick input.jpg logo.png -gravity center -geometry 200x200
-compose dissolve -define compose:args=30 -composite output.jpg
- -compose
dissolve + args=30 → makes it 30% transparent
- -geometry
200x200 → resize logo before placing
⚡ 3. Batch Watermark (all images
in folder)
magick mogrify -gravity southeast -pointsize 30 -fill white
-annotate +10+10 "© MyBrand" *.jpg
- Applies
watermark to all JPGs in the folder.
π You can mix these:
e.g., logo in the corner + text in the center.
Do you want me to make you a ready-to-use script
(Windows .bat or Linux .sh) so you can watermark multiple images at once
without typing commands every time?
Comments
Post a Comment