Skip to main content

[JAI-IMAGEIO] Efficient Way to Rescale an Image to 8-Bit

2 replies [Last post]
Anonymous

Can anyone show me the best way to rescale an image to 8-bit? Thanks!

George.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

Also note that you probably want to specify BYTE data type for the destination
image by passing a JAI.KEY_IMAGE_LAYOUT hint so you would use the form

RenderingHints hints;
RenderedOp dest = JAI.create("Rescale", pb, hints);

instead where 'hints' contains the ImageLayout hint containing a byte-valued
SampleModel.

Brian

On Thu, 25 May 2006, George Yang wrote:

> Can anyone show me the best way to rescale an image to 8-bit? Thanks!
>
> George.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

Use this operation

http://download.java.net/media/jai/javadoc/1.1.3-beta/javax/media/jai/op...

as

RenderedImage source;
double[] constants;
double[] offsets;
ParameterBlock pb;
RenderedOp dest = JAI.create("Rescale", pb);

where the source and parameters are passed in 'pb'.

Brian

On Thu, 25 May 2006, George Yang wrote:

> Can anyone show me the best way to rescale an image to 8-bit? Thanks!

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net