I like to spice up my desktop with various wallpapers and have to say, that /wg/ on 4chan has been a great provider.
But keeping track of all the images, shifting forth and back and forth again between the 10 pages has been taking too much effort.
So the solution to avoid spilling too much time lurking on that imageboard, I just wrote a bash script. (Sorry Windows users)
Be careful, as this script might run a while before it finishes.
You can modify the script as you like.
You might want to remove the user-agent string or the -nd option or ad a -x for that last wget call, etc…
I’ll post later on how I actually remove the duplicated images 😉
A hint for people eager to know: fdupes
fdupes -r -f . > duplicates && echo ./duplicates > duplicates && rm `cat duplicates`
This would actually throw errors when there are spaces in the filenames.
So it was a long, verry long night.
The spirit driving me was like this:
But in the end, it felt more like:
I went to a BBQ yesterday and took some pictures with my cheap 10 Mpx camera.
This resulted in some nice pictures I’d like to share with friends. (not trough facebook, tough)
The problem of today’s Mpx-hype is that pictures are two to three times bigger than my computer screen.
A .JPG picture of Width: 3648 pixels and Height: 2736 pixels results in a 4.8MB file.
One night of pictures can take several Gigabytes.
The problem of this is when you want to upload them to the internet, or you want to mail them to some friends, they’ll take too much bandwidth or eat your download-limit.
When not using picasa, flickr or facebook or some sort of internet service that is.
So for resizing all the images to something more reasonable, we could use The Gimp with the batch function (included in the gimp-plugin-registry package)
But as these are a lot of large images this would simply take too long as each picture has to be opened/displayed.
Instead I recommend the ImageMagick (set of) program(s) to edit all the pictures at once.
Use the mogrify program to resize images and replace the originals. If you like, you can also change the format (extension) while doing so.
If this is the first time you play around with the ImageMagick programs, you might want to make a backup as you could damage your files irreversible.
Go to the directory where the pictures you want to resize are located.
mogrify -resize 40% *.jpg
This will resize all files ending on .jpg to 40% of their original size. Note that the original files are replaced!
Now, if you want to convert all the .jpg files to .png’s as well, you can do this by using mogrify’s -format option like this:
mogrify -format png *.jpg
You can even do these two steps in one single command:
mogrify -resize 40% *.jpg | mogrify -format png *.jpg
So now you can relax and lay back till it’s done. 🙂