dreaper21 Posted April 4, 2007 Share Posted April 4, 2007 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 More sharing options...
monk.e.boy Posted April 4, 2007 Share Posted April 4, 2007 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 Link to comment https://forums.phpfreaks.com/topic/45529-random-pixel-generator/#findComment-221042 Share on other sites More sharing options...
dreaper21 Posted April 4, 2007 Author Share Posted April 4, 2007 If i knew how to program in C then id have a go at it! 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 Link to comment https://forums.phpfreaks.com/topic/45529-random-pixel-generator/#findComment-221063 Share on other sites More sharing options...
monk.e.boy Posted April 4, 2007 Share Posted April 4, 2007 why would a user want a web app to find a random pixel in their picture? Sounds like madness. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/45529-random-pixel-generator/#findComment-221095 Share on other sites More sharing options...
dreaper21 Posted April 4, 2007 Author Share Posted April 4, 2007 tis for a charity event. users give a quid to charity and 1 pixel appears.. the pixels have all the sponsors logos on it. joyous Link to comment https://forums.phpfreaks.com/topic/45529-random-pixel-generator/#findComment-221185 Share on other sites More sharing options...
monk.e.boy Posted April 4, 2007 Share Posted April 4, 2007 So if I pay £1,000,000 I get to see all the sponsor logos? Or just random pixels? monk.e.boy Link to comment https://forums.phpfreaks.com/topic/45529-random-pixel-generator/#findComment-221269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.