PHP or Photoshop filter?

About me: I am an everyday Joe Schmoe that enjoys spending way too much time on the internet. Internet technologies such as XHTML, PHP, CSS, and FLASH are my best friends and hobbies. They are daily learning experiences that I enjoy sharing with others.

Cat ScanGeeks around the Z were having a bit of fun today. I am an avid Photoshop and PHP guy and the wife is a writer who enjoys sharing her online adventures. I do my best not to train wreck this web-space with a PHP snafu but it does happen. Some day when you visit and it loads slower than a snail on a piece of rough concrete, you will KNOW I am online.

There is a point to this scenario. In fact, the average geek will find this pretty cool. I tinker with both Photoshop and PHP but I am a master of neither. My question to you, the visitor, what happened today? The chicken or the egg? Photoshop or PHP? Look at the image, was this another overused Photoshop filter? Or was it created with PHP? Can you tell?

UPDATE:
Just in case you missed the other installments of PHP Artwork:
We used the imageline in an article called PHP Artwork. Imageline and a FOR flow control can create some really cool “prisms.” The ImageTTFText installment utilized the built-in PHP function ImageTTFText to build a quick png graphic. Great for Captcha. The latest installment of PHP Artwork on our WordPress blog built a green box using the ImageFilledRectangle function and then added a caption to it using the PHP built-in function called ImageString.

Today while I was creating a few images for Desi’s article and thinking of post tags (we are an exciting bunch)… it kinda hit me. Time to break out of the norm, step away from the WordPress and do something different.

These graphics were dynamically created using PHP. No Photoshop and no filters. Kinda cool that a middleware built to drive dynamic websites can extend to such a level. I borrowed Desi’s NomNom graphic from her online Time Wasters article at 80px wide. Then loaded a snippet of coding and it created a pretty sharp image considering the one up top is using the ASCII # sign to recreate a full-screen colorized version with no distortion. Heck, the lighter image is using the word “cat.” You may not understand coding but a web “middleware” is used to call data from a database (dynamic content) and this same “middleware” created these images? Come on. Yes, it did, It can also output .SWF (Flash) and .PDF files. Thank you ASCII and PHP for bringing such joy. The proof is in the pudding; so here it is, the browser snapshot:

Cat Scan... creating PHP the Cat with PHP

The coding is short and easy to follow for you PHP folk. Give it a try! Believe it or not, this image was 80 pixels wide when PHP scaled it. Just make sure that you have your “resource” graphic in the same directory or fix the path. Be careful or you can put your computer in a bind using a “large” image.

<?php
$cat = ImageCreateFromJPEG('image.jpg');
$dx = ImageSX($cat);
$dy = ImageSY($cat);
for($y=0; $y < $dy; $y++){
for($x=0; $x < $dx; $x++){
$col = ImageColorAt($cat, $x, $y);
$rgb = ImageColorsForIndex($cat, $col);
printf ('<font color=#%02x%02x%02x>CAT</font>',
$rgb['red'], $rgb['green'], $rgb['blue']);
}
echo "<br>\n";
}
ImageDestroy($cat);
?>

Happy Coding,

Z

Tags: , , , ,

7 Comments So Far

  1. Desiree posted on March 29, 2010 | Permalink

    That is really cool. I can’t believe that is the same tiny picture from my article. It was a thumbnail. the ASCI images remind me of going to the State Fair of Texas when I was in 3rd or 4th grade. One booth was selling pictures of people using the the latest state of The art computer graphics…..getting your picture taken and having a computer generate a print out using all the different ASCI symbols that looked just like you from a distance. Black and white of course.

  2. Aiko posted on March 29, 2010 | Permalink

    Posted by me???

    Are you fooling around mate :-)

  3. Eric Zabinsky posted on March 29, 2010 | Permalink

    Too funny Aiko. What the? Crap. Gonna go check database status. Aiko? When did u marry my wife?

  4. Eric Zabinsky posted on March 29, 2010 | Permalink

    @Desi… freaky, right? Cannot believe I am using Twitter lingo in my own webhome. The shame of it all. #igottago.

  5. Aiko posted on March 30, 2010 | Permalink

    @ usmcsky “Aiko? When did u marry my wife?”

    When both of us realized time for change has come :-)

  6. WP Themes posted on April 1, 2010 | Permalink

    Good post and this post helped me alot in my college assignement. I am grateful for your information.

  7. Worker posted on April 16, 2010 | Permalink

    ЎHola!
    Super post, tienen que marcarlo en Digg
    Gracias

Register!

Flash by Z | The eclectic blogoshpere of Coding, Humor, Design and People


That's it - back to the top of page!

Recent Posts

POPULAR POSTS!