Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Mirrored text with Imager

by chanio (Priest)
on Jul 27, 2005 at 07:37 UTC ( [id://478499]=note: print w/replies, xml ) Need Help??


in reply to Mirrored text with Imager

Hi Zentara,

I tryied this script, but it complains the following...

>perl mirroredTxt.pl Can't call method "bounding_box" on an undefined value at mirroredTxt. +pl line 30. >Exit code: 2
Any idea what is missing? Imager.pm is installed.

{ \ ( ' v ' ) / }
( \ _ / ) _ _ _ _ ` ( ) ' _ _ _ _
( = ( ^ Y ^ ) = ( _ _ ^ ^ ^ ^
_ _ _ _ \ _ ( m _ _ _ m ) _ _ _ _ _ _ _ _ _ ) c h i a n o , a l b e r t o
Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established

Replies are listed 'Best First'.
Re^2: Mirrored text with Imager
by zentara (Archbishop) on Jul 27, 2005 at 12:10 UTC
    It probably can't find the "Generic.ttf" file, and therefore can't make any text to get a bbox on. I have a file called "Generic.ttf" in the directory where I run the script. You can copy any ttf file into your current directory, or specify the full path to a ttf file in the script.

    Reading "perldoc Imager::Font" will show you how to do it.


    I'm not really a human, but I play one on earth. flash japh
      Thank you, zentara!

      Sorry, I wasn't paying attention (it was too late at night).

      I changed ...

      $img_mirror->flip( dir => "v" ); ## "h"
      and...
      #make a unified image #~__ my $img_uni = Imager->new(xsize=>$pos_width * 2,ysize=>$global_a +scent,channels=>4); #~__ $img_uni->paste(left=>$pos_width,top=>0,img=>$img1); #~__ $img_uni->paste(left=>0,top=>0,img=>$img_mirror); my $img_uni = Imager->new(xsize=>$pos_width ,ysize=>$global_ascent * +2,channels=>4); $img_uni->paste(left=>0,top=>$global_ascent,img=>$img_mirror); $img_uni->paste(left=>0,top=>0,img=>$img1);
      To get the reflection that I was looking for.

      Is it possible to overwrite the generated image with another one?

      That is a Graphic Design technique to obtain sort of 3D characters that are easy to read on any background:

      • 1) write the text in white (##FFFFFF),
      • 2) overwrite the same text but changing the y offset 3 pixels down and offset x 5 pixels right , and in blue, for the example.
      Or even, overwriting the text three times: step 1, then overwrite with y offset of 6 pixels down and offset x 10 pixels right and in black, and finally overwrite with y offset of 3 pixels down and offset x 5 pixels right in blue.

      Then, in the mirror image it should be done in the opposite way: offset y up instead of down and offset x left instead of right.

      A \ \ / | _ _| __ \ <-|-> \ \ \ / __ \ _ \ __| _ \ _` | __ `__ \ | / V \ \ \ / | | | __/ | __/ ( | | | | | _| \_/\_/ _| |_|\___|_| \___| \__,_|_| _| _| ___| _) /"\/"\ "| |"|/"""|"| /"""| /""`"|"| "| "| """| ") A / / / \ | | | ""\ | ""\ ( | | | | | "| <-|-> / / / \ "" / " / ""| " / ", | "" ,"" / | \ v / / \ | " "| "" /
      (done with http://figlet.de)

      Anyway, thank you for the snipet.-

      { \ ( ' v ' ) / }
      ( \ _ / ) _ _ _ _ ` ( ) ' _ _ _ _
      ( = ( ^ Y ^ ) = ( _ _ ^ ^ ^ ^
      _ _ _ _ \ _ ( m _ _ _ m ) _ _ _ _ _ _ _ _ _ ) c h i a n o , a l b e r t o
      Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established
        Neat. It just gave me an idea of what this could be useful for. I guess a big thing in TV teleprompters is to make it look like the reader is looking straight into the camera, rather than below or above it at the teleprompter. A "homebrew" teleprompter could be made by placing a piece of glass at a slight angle between the video camera and the reader. Then place a monitor(or easier a flexible laptop) below the glass at such an angle that the reader can read the scrolling text reflected off of the glass, while appearing to be staring straight into the lens. I havn't experimented yet with the "flip" direction, but you should be able to keep a continuous left-to-right text scroll going, if you feed the images to a Tk Canvas and keep left-shifting them. :-)

        I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://478499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-16 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found