This is also the kind of thing that we do all the time in our Jython
intro to computing class -- the overall website (with draft versions of
the book and our classes available) is at
http://coweb.cc.gatech.edu/mediaComp-plan, and the course website is at
http://coweb.cc.gatech.edu/cs1315. We've built a set of Java classes
to create Picture, Pixel, Sound, and Sample objects, then Jython
wrappers so that we can write code like:
def clearBlue(picture):
for pixel in getPixels(picture):
setBlue(pixel,0)
Mark
On May 11, 2005, at 8:36 PM, Jeff Emanuel wrote:
If you find a Java image processing example that does
close to what you want, then it is straightforward to
translate to jython. Remove type declarations, braces,
semicolons, and new; check indenting and you are just
about there.
Maybe this will help for your image processing
http://www.developer.com/java/other/article.php/3403921
D. Hartley wrote:
Hello everyone,
Earlier, I used PIL in python to go through an image and "getpixel" -
getting the r, g, b, and alpha for pixel (x,y). (Actually for a whole
line of (x,y)'s, but nevermind that). The pixels in question are all
shades of grey, so r==g==b, and I only need one of these numbers for
each pixel.
So I'm looking through the image documentation for J2PSE, and saw
java's "getBlue" method under the ColorModel class. It says that it
"Returns the blue color component for the specified pixel, scaled from
0 to 255 in the default RGB ColorSpace, sRGB." Again, getting only
the blue value would be just fine for my current purposes, since
r==g==b.
But of course, since this documentation site is for java itself (and
not jython), it tells me all kinds of information I know nothing about
(public, private, etc), and doesnt tell me what I'd *most* like to
see: an example.
Does anyone have/know the location of a *simple* example/explanation
of how this method could be used in jython to determine the blue value
of a particular image? I'm pretty new to the language, but like I
said I completely figured out how to do this in python/PIL earlier
today, I'm just trying to transfer it over (since I can't use PIL in
jython).
Any ideas/pointers would be appreciated!
Thanks,
Denise
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Jython-users mailing list
Jython-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/jython-users
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jython-users mailing list
Jython-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/jython-users
__________
Mark Guzdial : Georgia Tech : College of Computing/GVU
Atlanta, GA 30332-0280
Collaborative Software Lab,
http://coweb.cc.gatech.edu/csl
http://www.cc.gatech.edu/~mark.guzdial/
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
|