PCLinuxOS-Forums
News: Happy Hump day!
 
*
Welcome, Guest. Please login or register. September 08, 2010, 06:00:05 PM


Login with username, password and session length


Pages: [1] 2   Go Down
  Print  
Author Topic: A script for wide screen wallpapers.  (Read 2620 times)
DrDOS
Hero Member
*****
Offline Offline

Posts: 1896


« on: July 06, 2009, 05:47:05 PM »

This is a simple script for making wide screen wallpaper images from the narrower variety. It isn't very sophisticated, it just crops from the middle of the image. It makes a new image with the file name prefixed by bkg- in the same folder as the original. Name it whatever you wish and set it executable in Properties, put it anywhere you want or make a link to it from anywhere you want, as it browses to your file. As is, it is set to 1440x900, just change the 1440 to your width and the 900 to your height. I could set it where you input the size every time but it really seems simpler just to edit it once and forget it. Then just click on it.

I thought I would be able to whip it out in ten minutes but ended up having to figure out how the file and path names worked, so it took about an hour. But it works the bomb!

PS: I amended ever so slightly so that you can test how it works just by pasting the code into a terminal window. Of course it will make a 1440x900 pixel image but you can test it on pictures large and small.

Code:
#!/bin/sh
IFS=$'\t\n'
#
# Dependencies: imagemagick, kview, zenity
#
function mkg_bkg {
MYDIR=$(zenity --file-selection --directory)
cd "$MYDIR"
MYFILE=$(basename $(zenity --file-selection));
zenity --info --text="$MYDIR/$MYFILE";
convert -resize '1440' -gravity center -crop 1440x900+0+0 +repage "$MYDIR/$MYFILE" "$MYDIR/bkg-$MYFILE"
kview "$MYDIR/bkg-$MYFILE"
}
mkg_bkg
Logged

If you know what you're doing it's called Engineering. If you don't know what you're doing it's called Research and Development. You can always charge more for Research and Development.
Joble
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6755


USA - Mountain Time


« Reply #1 on: July 06, 2009, 07:17:40 PM »

I admit to being clueless.  This will create a good image?  Not stretched or skewed?
Logged

Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System
DrDOS
Hero Member
*****
Offline Offline

Posts: 1896


« Reply #2 on: July 06, 2009, 09:20:30 PM »

I admit to being clueless.  This will create a good image?  Not stretched or skewed?

Yes, it will be re-sized to the specified width and cropped to the specified height. Then your wallpaper will look nice and not funky. Maybe I should write one for boot and splash screens. I'm also thinking about writing one for folder icons since the colors seem to be pretty limited for most themes.
Logged

If you know what you're doing it's called Engineering. If you don't know what you're doing it's called Research and Development. You can always charge more for Research and Development.
Joble
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6755


USA - Mountain Time


« Reply #3 on: July 06, 2009, 09:27:25 PM »

I will try this on my testbox, 1360x768, probably this weekend.  All the wallpapers look like crap.  Thanks!
Logged

Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System
Sproggy
Hero Member
*****
Offline Offline

Posts: 1078



« Reply #4 on: July 07, 2009, 01:04:24 AM »

where does this crop??? from the top or bottom .... or does is centralise then crop??? ....

this will cut off certain areas of an image ...

Kori
Logged

He whispered, "My precious child, I love you and will never leave you, never, ever, during your trials and testings. When you saw only one set of footprints, It was then that I carried you"
bones113
Hero Member
*****
Offline Offline

Posts: 1604

Cherish your loved ones everyday.


« Reply #5 on: July 07, 2009, 08:08:28 AM »

Thanks DrDos.
Logged

PCLinuxOS 2010.1 Kde on a Hp nc8430 laptop with centrino core duo @2.16 ghz, 4 gigs ddr2 , 160 gb sata hd, 15.4 hd wide screen, ati x1600 video @256 mb, dvdrw multi drive.

Registerd linux user #421571
Padma
Hero Member
*****
Offline Offline

Posts: 789


The Outbond


WWW
« Reply #6 on: July 07, 2009, 04:49:37 PM »

Sproggy: I haven't tested it, but as I read the script, it resizes it to a width of 1440, then crops off the top and bottom (centered) to make the final 1440x900.

Yes, it will trim off top and bottom, so some images may be noticeably affected.
Logged

1st Lieutenant, USAFR (Retired)
Co-Administrator: Civilization Fanatics Center

Ramblings of a Professional Computer Geek

MLU
NimbusII
Hero Member
*****
Offline Offline

Posts: 897



« Reply #7 on: July 08, 2009, 01:41:23 AM »

Shame it does not add a little sharpening to the softened image.
Logged

`Atheism` for the less gullible..
You can get by with Linux...but it`s gonna take time!..
DrDOS
Hero Member
*****
Offline Offline

Posts: 1896


« Reply #8 on: July 08, 2009, 08:42:22 AM »

Shame it does not add a little sharpening to the softened image.
I know that this could be a made a lot more sophisticated. But I was just taking a break from other projects and thought it might be nice to do this. And I'm not of the school that thinks every application should have every bell and whistle possible. And anyone is welcome to 'improve' it to their satisfaction and make it available.
Logged

If you know what you're doing it's called Engineering. If you don't know what you're doing it's called Research and Development. You can always charge more for Research and Development.
NimbusII
Hero Member
*****
Offline Offline

Posts: 897



« Reply #9 on: July 08, 2009, 08:56:44 AM »

I didn't mean to seem negative... I wasn't trying to be just a remark.... script is good, quick and very helpful
Logged

`Atheism` for the less gullible..
You can get by with Linux...but it`s gonna take time!..
Mark342
Full Member
***
Online Online

Posts: 183



« Reply #10 on: July 11, 2009, 02:06:33 PM »

That is a nice script, but I usually use the liquid rescale plugin for gimp to resize wallpapers to wide screen aspect ratios.
It doesn't stretch the important features of the wallpaper, and it doesn't crop anything off.
http://liquidrescale.wikidot.com/en:examples#toc1
Logged

Insanity is hereditary.  You get it from your kids.

Registered Linux user #493318
Register yourself here: Linux Counter
gseaman
Hero Member
*****
Offline Offline

Posts: 1840



« Reply #11 on: July 11, 2009, 03:44:13 PM »

A short introduction to this plugin would make a great article for the magazine!
Galen
Logged
slax
Full Member
***
Online Online

Posts: 213



WWW
« Reply #12 on: July 12, 2009, 09:22:41 AM »

I was trying to make nautilus script, but for some reason i cant get it to work Tongue any help?

Code:
#!/bin/sh
IFS=$'\t\n'
#
# Dependencies: imagemagick, kview, zenity
#
function mkg_bkg {
#MYDIR=$(zenity --file-selection --directory)
#cd "$MYDIR"

#MYDIR=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS;
#MYFILE=$(basename $(zenity --file-selection));


MYDIR=$NAUTILUS_SCRIPT_CURRENT_URI;

MYFILE=$@;

zenity --info --text="$MYDIR/$MYFILE";
convert -resize '1440' -gravity center -crop 1440x900+0+0 +repage "$MYDIR/$MYFILE" "$MYDIR/bkg-$MYFILE"
kview "$MYDIR/bkg-$MYFILE"
}
mkg_bkg
Logged

lyric
Full Member
***
Offline Offline

Posts: 68


« Reply #13 on: July 22, 2009, 07:33:23 PM »

That is a nice script, but I usually use the liquid rescale plugin for gimp to resize wallpapers to wide screen aspect ratios.
It doesn't stretch the important features of the wallpaper, and it doesn't crop anything off.
http://liquidrescale.wikidot.com/en:examples#toc1


Impressive!  Thanks for that link.
Logged

Crow
Hero Member
*****
Offline Offline

Posts: 4049


Sandbox Gang Member PCLinuxOS e17 Club Member


WWW
« Reply #14 on: July 22, 2009, 10:43:37 PM »

That is a nice script, but I usually use the liquid rescale plugin for gimp to resize wallpapers to wide screen aspect ratios.
It doesn't stretch the important features of the wallpaper, and it doesn't crop anything off.
http://liquidrescale.wikidot.com/en:examples#toc1



Do you have to compile it?
Logged

Linux User #330412


My computer geek score is greater than 82% of all people in the world! How do you compare? Click here to find out!
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM