Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By limnion
  1. limnion's Avatar
    Posts
    4 Posts
    Global Posts
    2 Global Posts
       #1  
    So, I was a little bit bummed when I found out that my TouchPad didn't have fancy options for scaling or tiling wallpaper, so I wrote a set of simple BASH scripts that perform various batch operations on images to make them more TouchPad-friendly. This one center-tiles smaller images across a 1024x1024 canvas. It's not perfect, but this is the least buggy of the bunch. Here goes:

    Code:
    #!/bin/bash
    
    if [ ! -d ./tiled ]
    	then
    		mkdir ./tiled
    fi
    
    for file in ./*.*
    do
    	if [ $file != $0 ]
    		then
    			imgw=`convert $file -format "%[fx:w]" info:`
    			imgh=`convert $file -format "%[fx:h]" info:`
    			xo=$((0-((1024-$imgw)/2-$imgw)))
    			yo=$((0-((1024-$imgh)/2-$imgh)))
    			echo Tiling $file...
    			convert $file \( -clone 0 \) +append -write mpr:sometile +delete -size 1024x1024 -tile-offset +$xo+$yo tile:mpr:sometile tiled/$file
    	fi
    done
    The processed file is placed in ../tiled because I didn't write anything in to compensate for the presence of anything other than the script and unprocessed images in the working directory. Truth be told, this is very kludgy code, but it gets the job done for the most part. Hopefully someone finds it useful. Example output made from a scaled down photo of some canned oysters is appended below.

    Edit: So, for some reason smaller images and some PNGs don't tile correctly. From what I can tell, it's an ImageMagick problem, so I'm not sure what I can do about it.

    Edit 2: Now tiled images are placed in a subdirectory called tiled. Will still freak out if there are non-image files in the directory, but directories and files without an extension won't freak it out anymore.
    Attached Images Attached Images
    Last edited by limnion; 02/24/2013 at 08:02 PM. Reason: Fixed directory and wildcard issues
    HelloNNNewman likes this.
  2. #2  


    (to proper forum)



    Network Moderator | Mobile Nations Rules

Tags for this Thread

Posting Permissions