Hi there,
In Swing/Java AWT, is there any way to specify pen color parameters so
that if you draw over a an existing pixel using the same color, that
the intensity of that pixel increases? I'm not sure that alpha
blending works to do what I want: for instance, say pixel (100,100) is
very light gray: I want successive calls to draw pixel (100,100) with
the same light gray color to make that pixel more and more white.
Thanks!
Isaac
PS - In case you are wondering, I'm designing a solution to render very
sparse, 100 millionx100 million matrices that contain values 0 and 1 at
various levels of zoom. I want to set up a situation where multiple
matrix cells with value 1 that map to the same pixel will be brighter (
closer to pure white ) than pixels that map to only one 1 cell. If the
answer to the above question is "yes", then I can draw light gray
pixels to represent each "1" with brightness proportional to how
diluted that value is, and not have to worry about first averaging the
values of the neighbors before drawing.
|
|
0
|
|
|
|
Reply
|
isaacyho (15)
|
3/10/2006 6:38:46 PM |
|
> In Swing/Java AWT, is there any way to specify pen color parameters so
> that if you draw over a an existing pixel using the same color, that
> the intensity of that pixel increases? I'm not sure that alpha
> blending works to do what I want: for instance, say pixel (100,100) is
> very light gray: I want successive calls to draw pixel (100,100) with
> the same light gray color to make that pixel more and more white.
alpha blending should work.
First time you draw background then
you set AlphaComposite on Graphics2D
and repeatedly draws your image.
--
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
|
|
0
|
|
|
|
Reply
|
Andrey
|
3/10/2006 6:53:08 PM
|
|
"Andrey Kuznetsov" <spam0@imagero.com.invalid> wrote in message
news:dushuf$l43$1@online.de...
>> In Swing/Java AWT, is there any way to specify pen color parameters so
>> that if you draw over a an existing pixel using the same color, that
>> the intensity of that pixel increases? I'm not sure that alpha
>> blending works to do what I want: for instance, say pixel (100,100) is
>> very light gray: I want successive calls to draw pixel (100,100) with
>> the same light gray color to make that pixel more and more white.
>
> alpha blending should work.
> First time you draw background then
> you set AlphaComposite on Graphics2D
> and repeatedly draws your image.
It works if you're drawing on a black background, and using a white
translucent pen (e.g. RGBA=(255,255,255,128)).
To do what the OP described regardless of background colour and pen
colour, I think you'd need a HSL colour model, where the H and S values of
the pen override the surface values, while the L value is additive (or
something more complex) against the surface value.
- Oliver
|
|
0
|
|
|
|
Reply
|
Oliver
|
3/10/2006 7:22:48 PM
|
|
|
2 Replies
209 Views
(page loaded in 0.078 seconds)
Similiar Articles: draw: how to layer colors? - comp.lang.java.guiHi there, In Swing/Java AWT, is there any way to specify pen color parameters so that if you draw over a an existing pixel using the same color, that... how to bucket fill? - comp.graphics.apps.gimpdraw: how to layer colors? - comp.lang.java.gui Hi there, In Swing/Java AWT, is there any way to specify pen color parameters so that if you draw over a an existing pixel ... PSP9: Bitmap to vector - how to? - comp.graphics.apps.paint-shop ...Corel has "trace" as part of the Draw package and there is Raster2Vector ... draw: how to layer colors? - comp.lang.java.gui PSP9: Bitmap to vector - how to? - comp.graphics ... GUI colors Linux - comp.soft-sys.matlabI wondered if it is possible to change the colors of the graphical user ... draw: how to layer colors? - comp.lang.java.gui GUI colors Linux - comp.soft-sys.matlab GUI ... Tao.Platform.Windows.SimpleOpenGlControl texture problem - comp ...... buffer pfd.iLayerType = (byte) Gdi.PFD_MAIN_PLANE; // Main drawing layer ... It could also be that your model color is blue, and only reflect the blue color. Display resolution, structure, color space of PDF file - comp.text ...draw: how to layer colors? - comp.lang.java.gui... has "trace" as part of the Draw package and there ... The alternative is to trace it yourself on a vector layer ... Sketch Picture Transparency - comp.cad.solidworksdraw: how to layer colors? - comp.lang.java.gui... on Graphics2D > and repeatedly draws your image. ... Now you will start to sketch out what you would like to ... can ... Draw constant size object regardless of zoom - comp.graphics.api ...draw: how to layer colors? - comp.lang.java.gui Draw constant size object regardless of zoom - comp.graphics.api ... draw: how to layer colors? - comp.lang.java.gui Draw ... How to change vga parameters? - comp.os.linux.miscdraw: how to layer colors? - comp.lang.java.gui Hi there, In Swing/Java AWT, is there any way to specify pen color parameters so that ... SW DWG editor - comp.cad ... translucent windows - comp.graphics.api.opengldraw: how to layer colors? - comp.lang.java.gui translucent windows - comp.graphics.api.opengl draw: how to layer colors? - comp.lang.java.gui It works if you're drawing ... How to Color Layer by Layer in Manga Studio | eHow.comUnlike paint programs, where you can mix colors on any layer, Manga Studio only allows one color per layer. As a consequence you must plan carefully before you draw. How to Layer Colored Pencil Tones - Yahoo! Voices - voices.yahoo.comMake pencil strokes move in a single direction for your first layer of color, with ... It has wonderful hints on how to do color pencil drawing that are layered and so forth. 7/24/2012 3:35:34 AM
|