topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 6:02 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: text as windows wallpaper  (Read 14259 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
DONE: text as windows wallpaper
« on: November 05, 2005, 02:30 AM »
I'd love a commandline tool that could be invoked by our Popup Wisdom program (and other tools), that would take a string of text on commandline (or text file input name even better), and make a graphic image of this text, sized to the desktop, and then set as the wallpaper image.

In other words, i want a short text file or quote to be displayed as a graphic wallpaper image - and it needs to rescale it so that it fits nicely (maybe parameters for font and padding).

seems like it would be quite a useful commandline tool - not too sure how hard it would be to figure out the proper size of the font to fit on the page; it's ok if it takes a second or two to (off screen) try to fit the text.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #1 on: November 05, 2005, 05:16 PM »
ImageMagick command line tool ...

example:

convert -size 320x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 -draw "text 25,60 'Magick'" \
    -channel RGBA -gaussian 0x6 -fill darkred -stroke magenta -draw "text 20,55 'Magick'" fuzzy-magick.png

produces



see here for details

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #2 on: November 05, 2005, 05:30 PM »
first, that is beautiful.
second, yeah i thought of imagemagick -
however my problem in this case is that i've got potentially several lines of text, maybe 1 maybe 10, of varying length, and the key is i need it scaled to fit a specific size.
i suppose one way would be to make a HUGE image, using a pointsize like 72, and then scale the image itself to fit desired size, though my original intention was to figure out font size that would fit.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #3 on: November 05, 2005, 05:34 PM »
There must be a windows API call that can tell you the dimensions of a string displayed in a particular font ?? This could give you the maximum line length for one of your lines and allow you to calculate the overall dimensions of the image required to hold the multiple lines of the image. Create it and then scale it to fit the screen size and output as GIF.

As for multiple lines, I presume ImageMagick and join images, so you could just make multiple images and join them together, and then scale.

PS. If you want the binaries for windows the download link is here and you can download the source code here
« Last Edit: November 05, 2005, 06:08 PM by CarolHaynes »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #4 on: November 05, 2005, 07:12 PM »
Just found this site which may also help ... http://www.tonec.com...cim/samples/s19.html

also:

http://forum.java.su...mp;messageID=3872343

Another fun tool (but not easy to automate, although I suppose you could use a macro engine to do it) is Xara3D. (Downloadable demo version here

I have been using Xara's graphics apps since long before they even though of writing for Windows (and even before they were called Xara) and they are uniformly excellent: XaraXtreme rivals Adobe Illustrator at a fraction of the cost.

Xara3D does one task really well ... it takes text and converts it into images (mainly for use on webpages), applying wonderful effects as you go (including 3D animation etc). You can export the produced graphics in all sorts of formats including animated GIFs, plain image files and even screen saver files.

Here is an example from the "Book of Corkscrews" that I knocked together in about 30 seconds ... and below that an animation based on an example from Xara ...

« Last Edit: November 05, 2005, 07:26 PM by CarolHaynes »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #5 on: November 05, 2005, 08:33 PM »
And another ... Sorry, getting carried away  :-[
« Last Edit: November 05, 2005, 08:43 PM by CarolHaynes »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #6 on: November 05, 2005, 08:35 PM »
wow cool!!!

last one is a bit hard to read though - first i thought it was in japanese  ;D

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #7 on: November 05, 2005, 08:43 PM »
Changed it ...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #8 on: November 05, 2005, 09:11 PM »
that's quite nice - is that border design built in or did you draw and extrude it?

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #9 on: November 06, 2005, 06:15 AM »
included but you can do things  - I extruded, changed colours, lighting etc.

Have to say I need to find out how to use the web pallette as that isn't exactly how I produced it.
« Last Edit: November 06, 2005, 06:17 AM by CarolHaynes »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #10 on: November 07, 2005, 06:18 AM »
Mouser ...

I've been emailing with an ImageMagick guru ....

Regarding finding text sizes etc check out his webpage tutorials. When you go to the pages there are so many graphics etc. they take a while to load and the # operator isn't brilliant. Best thing is to wait for the page load to finish then click on the URL bar to go to the page again - it will redraw in the correct location.

Here is a quote form an email:

Yes, get a size my using label: with the same setting.

Or draw it on a canvas with a -box color, and trim it down to that
box color..

Both methods are detailed in
  Text to Image Handling -- Auto Sizing of Font Images
    http://www.cit.gu.ed.../imagick6/text/#size

However the box method will if you look up the 'trim' offset and actual
image size results (before doing a +repage) will also let you figure
out
the baseline setting for that font at that size.

For example of reading 'trim' results see..
  Cutting and Bordering -- Trimming 'Noisy' Images
    http://www.cit.gu.ed...ick6/crop/#trim_blur

You draw the text at a specific point (known base line position)
with a -box setting.  You then trim and see where the box
was positioned relative to that baseline starting point.

Thanks go to Anthony Thyssen for his help. His main tutorials/examples are here
« Last Edit: November 07, 2005, 06:22 AM by CarolHaynes »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #11 on: November 07, 2005, 06:37 AM »
great find!
going to check those out.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #12 on: November 07, 2005, 06:39 AM »
How about this:

convert -background lightblue  -fill blue  -font Calligraphic-Regular -pointsize 40 -size 800x640  -gravity Center  caption:"Dying is easy.\nComedy is Difficult.\nActor Edmond Gween\non his deathbead." caption_centered.gif

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #13 on: November 07, 2005, 09:04 AM »
that's exactly what i want, except i need to be able to have it figure out pointsize based on text.  but that is damn nice and maybe good enough with a little bit of guesswork.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: text as windows wallpaper
« Reply #14 on: November 07, 2005, 09:16 AM »
ok carol is right, with the info on the other page above,
it should be possible to do what i want in a three step process
1) render text into image at something like 72 point and have it autosize the image to fit the font.
2) shrink the image if its too big to fit on desktop target size
3) put the image on a nice background.

i think this would be a very useful front end commandline tool to use with imagemagick...
anyone want to give this a shot before i do?

here's what i was thinking: commandline tool
MakeTextImage myimage.bmp -x 1600 -y 1200 -t "Text to display\nLine two of text"
or
MakeTextImage myimage.bmp -x 1600 -y 1200 -f testfilename.txt

would be nice to have options also for font and colors.