Re: A kewl Script, for you someone to test, and show me the results
| From: | ReDucTor | Date: | Thu, 27 Sep 2001 16:00:21 +0000 |
| Subject: | Re: A kewl Script, for you someone to test, and show me the results | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69020@lists.php.net to get a copy of this message | ||
small, and fun to play with...hehe
----- Original Message -----
From: "Chris Lee" <lee@mediawaveonline.com>
To: <php-general@lists.php.net>
Sent: Friday, September 28, 2001 1:53 AM
Subject: Re: [PHP] A kewl Script, for you someone to test, and show me the
results
> I found 'W' worked best to maintain aspect ratio, and minimize the font.
>
>
http://www.mediawaveonline.com/test.php?image=www.atalasoft.com/Images/stefa
> n_full_rgba.png
>
> <html>
> <body bgcolor='000000' style='font-size: 1%'>
> <?php
> echo "
> <img src='http://$image'><br>
> ";
> $im = ImageCreateFromPNG("http://$image");
> for($y = 0; $y < imagesy($im); $y++)
> {
> for($x = 0; $x < imagesx($im); $x++)
> {
> $color = ImageColorsForIndex($im, ImageColorAt($im, $x, $y));
> echo "<font color='";
>
> printf("%02x%02x%02x",$color['red'],$color['green'],$color['blue']);
> echo "'>W</font>";
> }
> echo '<br>';
> }
> ?>
> </body>
> </html>
>
> this was defn a fun script haha. thanks guys.
>
> --
>
> Chris Lee
> lee@mediawaveonline.com
>
>
> "Rasmus Lerdorf" <rasmus@php.net> wrote in message
> news:Pine.LNX.4.33.0109270046390.1491-100000@master.php.net...
> > Oh, by the way, I modified your script a bit and made it load an indexed
> > PNG file instead. This is the modified script:
> >
> > http://www.php.net/~rasmus/reductor.phps
> >
> > And here is the result:
> > http://www.php.net/~rasmus/reductor.php
> >
> > Not sure why you used a $ sign for the character. It sort of throws off
> > the aspect ratio. Try a # instead:
> > http://www.php.net/~rasmus/reductor.php?ch=%23
> >
> > -Rasmus
> >
> > On Thu, 27 Sep 2001, ReDucTor wrote:
> >
> > > Hey,
> > > I couldn't be bothered waiting for someone to show me a host that
> runs
> > > php with GD, so i am just going to post the code here, and hope that
> someone
> > > sees it, and checks it out, and shows the results
> > >
> > > If you can't find a jpg file to test this on, just grab the php jpg
one,
> > > well i'll post the code now, so people can play with it, remember if
you
> > > test it place show the results :D
> > >
> > > btw if you don't understand how to use it, you paste the code into a
> .php
> > > file, and change imgname to the path of an jpg image, if you want to
use
> an
> > > png image, just change the im to ImageCreateFromPNG, ok, thats
> all...please
> > > show the results
> > >
> > > <html>
> > > <body bgcolor="#000000">
> > > <?php
> > > $imgname = "/path/to/a/jpeg/file";
> > > $im = ImageCreateFromJPEG($imgname);
> > > $output = " ";
> > > for($x=0;$x<imagesx($im);$x++)
> > > {
> > > for($y=0;$y<imagesy($im);$y++)
> > > {
> > > $color = ImageColorsForIndex(ImageColorAt($im, $x, $y));
> > > echo "<font size=\"1\" color=\"#";
> > > echo dechex($color['red']);
> > > echo dechex($color['green']);
> > > echo dechex($color['blue']);
> > > echo "\">\$</font>";
> > > }
> > > echo "<br>\n";
> > > }
> > > ?>
> > > </body></html>
> > >
> > > - James "ReDucTor" Mitchell
> > >
> > >
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>