Jump to content

Random pixel generator


dreaper21

Recommended Posts

Ok i need help!

 

Im trying to create a program that generates random pixels from a set picture.. i know how to write a random number generator its just figuring out how to take that one step further and getting it to grab pixels from a picture and show them one by one when somebody clicks generate button.

 

there needs to be 1,000,000 pixels in total. Raar my head hurts trying to think of a way to do it!  ???

 

if ne1 could help would be great!

 

Damien

Link to comment
https://forums.phpfreaks.com/topic/45529-random-pixel-generator/
Share on other sites

PHP sounds like the worst language to use to do this, but hey, lets think...

 

You can use the GD library [http://uk.php.net/gd] measure the width and height of the image, then use:

 

get_pixel( random(0,width), random(0,height)

 

over and over?

 

If I were you I'd write this in c, then call it from the system() command.

 

monk.e.boy

If i knew how to program in C then id have a go at it! :P

 

il do a test of the method you suggest and see how that goes

i could try link up the get_pixel command to a front end button for the users to click on

 

all i can do is try!

 

cheers for advice

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.