Re: [Dorset] xloadimage

2010-10-11 Thread jr
hi Andrew,

> Hi Ralph,
>        thanks for that, convert/composite works fine - but gee! it's 
> noticeably
> slow!

hm, just how frequently do you need to change the background on your
root window?

-- 
regards, jr.

time flies like an arrow, fruit flies like a banana.

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


[Dorset] xloadimage

2010-10-10 Thread Andrew R Paterson
Hi Ralph,
thanks for that, convert/composite works fine - but gee! it's 
noticeably 
slow!
Despite ImageMagick being around for many years, I never thought of it being 
much more than display(1) :)
I'll have a look at netpbm/pnmcomp.
-- 
Andy Paterson

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] xloadimage - transparent images

2010-10-10 Thread Ralph Corderoy

Hi Andy,

> using imagemagick has solved my background problem thanks

I had a quick look at xloadimage's source;  I don't think it handles
transparent pixels at all.

There's also netpbm to do the image composition, but I think it would
take more steps.  The transparency mask would be extracted to a PGM and
then used, e.g. with pnmcomp(1).

Cheers,
Ralph.


--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] xloadimage - transparent images

2010-10-10 Thread jr
hi Andrew,

> using imagemagick has solved my background problem thanks, my bash function is
> now (roughly)

nothing like a bit of magic. :-)

been thinking that this quite a useful bit of code.   how about
putting it, documented, onto the Wiki?

-- 
regards, jr.

time flies like an arrow, fruit flies like a banana.

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue



Re: [Dorset] xloadimage - transparent images

2010-10-10 Thread Andrew R Paterson
On Saturday 09 October 2010, jr wrote:
> hi Andrew,
> 
> > TIA for any assistance/suggestions
> 
> don't have 'xloadimage' on my machine, however, if you have the
> ImageMagick(1) software installed, 'composite' will combine images.

Hi jr et al
using imagemagick has solved my background problem thanks, my bash function is 
now (roughly)
-->%
dologo() {
BACK="images/virgin.jpg"
LOGO="images/logo.gif"
COPYRIGHT="images/copyright.gif"
# Get the root window size
set `xwininfo -root | grep Width`
shift
width=$1
set `xwininfo -root | grep Height`
shift
height=$1
echo "screen is $width X $height"

# Get the correct zoom factor
xzoom=`expr $width \* 100`
#  1280 is the X resolution of BACK
xzoom=`expr $xzoom \/ 1280`
yzoom=`expr $height \* 100`
#  1024 is the Y resolution of BACK
yzoom=`expr $yzoom \/ 1024`

convert ${BACK} -resize ${xzoom}x${yzoom}% composite.gif
# Set the positions of the COPYRIGHT and LOGO
copyright_x=`expr $width - 350`
copyright_y=`expr $height - 40`
logo_x=`expr $width - 350`
logo_y=`expr $height - 200`

composite -geometry +${logo_x}+${logo_y} ${LOGO} composite.gif \ 
composite.gif
composite -geometry +${copyright_x}+${copyright_y} ${COPYRIGHT} \ 
composite.gif composite.gif
# Blat the background
xloadimage -fullscreen -onroot composite.gif
}

-->%
-- 
Andy Paterson

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


[Dorset] xloadimage

2010-10-09 Thread Andrew R Paterson
Hi again jr,
I see what you mean with composite(1) from ImageMagick.
I will looke into this,.
Apologies for my previous reply - thanks very much for this suggestion.
I will try to build the image using composite(1)  then load it.
I'll let you know if I succeed.
-- 
Andy Paterson

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] xloadimage - transparent images

2010-10-09 Thread jr
hi Andrew,

> thanks for that, but I dont think I can get display (the imagemagick viewer)
> to load onto multiple images onto the root window :(
> Unless you know otherwise.

'composite' can save the combined result in a new file, also,
'convert' and 'mogrify' can be used to manipulate images.

-- 
regards, jr.

time flies like an arrow, fruit flies like a banana.

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] xloadimage - transparent images

2010-10-09 Thread Andrew R Paterson
On Saturday 09 October 2010, you wrote:
> hi Andrew,
> 
> > TIA for any assistance/suggestions
> 
> don't have 'xloadimage' on my machine, however, if you have the
> ImageMagick(1) software installed, 'composite' will combine images.
Hi jr,
thanks for that, but I dont think I can get display (the imagemagick viewer) 
to load onto multiple images onto the root window :(
Unless you know otherwise.
Thanks again

-- 
Andy Paterson

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] xloadimage - transparent images

2010-10-09 Thread jr
hi Andrew,

> TIA for any assistance/suggestions

don't have 'xloadimage' on my machine, however, if you have the
ImageMagick(1) software installed, 'composite' will combine images.

-- 
regards, jr.

time flies like an arrow, fruit flies like a banana.

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


[Dorset] xloadimage - transparent images

2010-10-09 Thread Andrew R Paterson
Hi all,
Is there anyone familiar with the use of xloadimage/xsetbg who 
can 
give me a hint as to why I can't load a small image with a transparent 
background image onto an existing background image.
In the following bash shell function, virgin.jpg is intended to cover the 
whole background, with one.jpg and two.gif being smaller images (edited with 
the GIMP) with transparent backgrounds.
I can't seem to load an image with a transparent background onto an existing 
root window with the transparent bit showing the original background image - 
the transparent bits of one.jpg and two.gif always show white.

TIA for any assistance/suggestions

Andy
--->% 

 
dologo() {
BACK="images/virgin.jpg"
LOGO="images/one.jpg"
COPYRIGHT="images/two.gif"
# Get the root window size
set `xwininfo -root | grep Width`
shift
width=$1
set `xwininfo -root | grep Height`
shift
height=$1
echo "screen is $width X $height"

# Get the correct zoom factor
xzoom=`expr $width \* 100`
#  1280 is the X resolution of BACK
xzoom=`expr $xzoom \/ 1280`
yzoom=`expr $height \* 100`
#  1024 is the Y resolution of BACK
yzoom=`expr $yzoom \/ 1024`

echo "xzoom=$xzoom yzoom=$yzoom"

# Set the positions of the COPYRIGHT and LOGO
#   copyright_x=`expr $width - 400`
copyright_x=`expr $width - 350`
copyright_y=`expr $height - 40`
#   logo_x=`expr $width - 200`
logo_x=`expr $width - 150`
logo_y=`expr $height - 100`

# Blat the background

xloadimage -fullscreen -onroot -xzoom $xzoom -yzoom $yzoom ${BACK} -
merge -at $logo_x,$logo_y ${LOGO} -merge -at $copyright_x,$copyright_y 
${COPYRIGHT}

}

--->% 

-- 
Andy Paterson

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue