Quantcast

Changing pixels to white in a picture

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Changing pixels to white in a picture

od11kd
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing pixels to white in a picture

Jeff Emanuel
The Python random number generator is available from

import random

You can read image files using the Java awt Toolkit class.

import java
image = java.awt.Toolkit.getDefaultToolkit().getImage(yourImageURL)



On 2/26/2013 8:25 AM, od11kd wrote:

> Hey guys, I am trying to write a function that will create a random number
> (between m and n, inclusive) of stars in the sky for this picture:
>
>    <http://python.6.n6.nabble.com/file/n5007930/assignment3HarvestMoon.jpg>
> .
>
> Each so-called star should be randomly composed of either a single white
> pixel, or a square of 4 adjacent white pixels.
>
> I should not place a 'star' (of 1 pixel) over the tree branches, the moon or
> the bird! However, a larger 'star' could infringe on the tree, moon or bird.
> Ensure that you do not attempt to place any 'star' outside the boundaries of
> the picture. Don't worry if stars are adjacent to each other, or even if
> they cover another.
>
> After, I want to print, in white, near the top and approximately in the
> middle, a line for each of:
> Total number of small stars
> Total number of large stars
> Total number of stars shown, and
> Total number of stars that are obscured (i.e. behind an object in the
> picture)
>
>
>
> --
> View this message in context: http://python.6.n6.nabble.com/Changing-pixels-to-white-in-a-picture-tp5007930.html
> Sent from the jython-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Jython-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jython-users

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Loading...