I hate PDFs! I hate opening the viewer and sitting there, waiting for it to load, then dealing with the pop up asking me to update my software. I wish they were like regular text files or images, and not some twisted mutant hybrid of both with all the shortcomings from each side! So… now I just convert PDF’s to JPEG images!!! I love ImageMagick. It’s just so freaking useful… and free.
Here’s a very simple script to convert PDF’s to JPG’s:
#!/bin/sh
/usr/bin/convert -colorspace RGB -resize 1024 -interlace none -density 300 -quality 85 $1 $1.jpg
Lets take the U.S. Immigration form for example. I downloaded the four page I-9.pdf from uscis.gov. It took 11 seconds on my machine to convert it into 4 jpeg image files. You could do a whole directory full of pdfs all at once in a matter of minutes. Print them, display them on the internet, or just view them in your favorite image/photo software. Easy access, and no PDF viewer needed at all!
Linux, ooo! Shiny... easy, files, ImageMagick, images, jpeg, jpg, pdf
For those of you still loading your digital camera’s images into MSPAINT or paying hard earned $$$ for some crappy program just to shrink the size and quality to get normal file sizes that display easily and upload faster to your favorite photo sites:
Do it in 1 freaking command in cygwin, andlinux, or native!!!
find . -iname “*.jpg” | xargs -l -i convert -resize 70% -quality 75 {} /tmp/output/{}
ooo! Shiny... batch, convert, digital camera, file size, ImageMagick, mspaint
For those of you still loading your digital camera’s images into micro$oft’s paint program or paying $$$ for something just to shrink the size and quality to get normal file sizes that display easily and upload faster to your favorite photo sites:
Do it in 3 seconds in cygwin, andlinux, or native linux!!!
find . -maxdepth 1 -iname “*.jpg” | xargs -i convert -resize 65% -quality 85 {} ~/{}
Viola, you’ll find them all in your home directory if you ran this in the directory where your images were… If you’re taking the highest resolution photos with your 10+ megapixel camera, you’ll want to throw away most of that garbage, so 65% size reduction probably won’t cut it. Play with the values and see how it looks…
Try a bunch of different quality settings. I found anything below 80% was noticable for big photos, but thumbnails could go much lower without immediately obvious distortion.
for x in 1 2 3 4 5 6 7 8 9; do convert -resize 50% -quality $x0 original.jpg quality_$x0.jpg; done
Now try “eog quality*.jpg” to cycle through the results real quick and you should notice the image distortion changing like a flipbook.
Linux, ooo! Shiny... convert, eog, ImageMagick, jpg, quality, resize
You can take several regular pictures or other image files and put them together into one image that looks like they’re all polaroids laid out on a desk using ImageMagick’s montage tool. If you have a dual monitor setup you can easily fit 8 across your screens at once without even overlapping much. Or you could lay them out half-covering each other to get a whole album on the screen at once. Don’t worry about the size of each image either because you’ll take thumbnails of each of them to make the final larger image.
[user@hostname ~]$ /usr/bin/montage -size 3200×1200 ~/Pictures/*.jpg -thumbnail 722×594 -bordercolor Lavender -background black +polaroid -background DarkGray -geometry -30-47 -tile x2 ~/Pictures/montage.gif
You could rotate the pictures in a script and run it in a crontab every hour to rotate your pictures for the next time you make the montage pic. If you’re not constantly downloading a new image (such as a satelite weather map or something), you could bump each file’s name along, saving the last one in a temporary position before rotating it back to the beginning of your stack. The simplest way to do this would be just moving the file names one by one. Think of it as files “new”, “old”, “older”, and “oldest”.  Use “temp” as a placeholder while you bump the names along in the chain.
[user@host ~]$ mv -f oldest.jpg temp.jpg; mv -f older.jpg oldest.jpg; mv -f old.jpg older.jpg; mv -f new.jpg old.jpg; mv -f temp.jpg new.jpg
And if you’re using Gnome you can run gconftool-2 to swap out your background image on the fly everytime the cron runs.
[user@host ~]$ /usr/bin/gconftool-2 –type string –set /desktop/gnome/background/picture_filename “$HOME/Pictures/montage.gif”
Linux, ooo! Shiny... backgrounds, cron, ImageMagick, montage, polaroid
Recent Comments