You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Adrian Sampaleanu <Ad...@mgisoft.com> on 2001/04/24 00:14:42 UTC

Bicubic interpolation for scaling

Hello,

  What is the current stance on interpolation quality with respect to Batik?
Sun currently doesn't support bicubic interpolation as a rendering hint in a
Graphics2D context, but they seem to have addressed the issue (I'm not sure
to what degree) in JAI. We're currently having some pretty bad moire effects
when scaling down and we thought that using bicubic interpolation would
help, but alas it is not to be! :-(

We would appreciate any clarification regarding image scaling quality within
Batik - will Batik ever use JAI?

Thank You,
Adrian Sampaleanu

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Bicubic interpolation for scaling

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "AS" == Adrian Sampaleanu <Ad...@mgisoft.com> writes:

AS> Hello, What is the current stance on interpolation quality with
AS> respect to Batik?  Sun currently doesn't support bicubic
AS> interpolation as a rendering hint in a Graphics2D context, but
AS> they seem to have addressed the issue (I'm not sure to what
AS> degree) in JAI. We're currently having some pretty bad moire
AS> effects when scaling down and we thought that using bicubic
AS> interpolation would help, but alas it is not to be! :-(

    In order to properly scale down by large amounts properly you need
to "blur" the image before subsampling.  Using more sophisticated
interpolents (such as bicubic) helps, but unless you grow the
interpolent kernel size in accordance with the resample factor they
stop working after a certain point.

    Batik contains all the required infrastructure to do proper
subsampling of images, I'm preparing to check in a new version of the
raster image support (a pluggable API for new file format support).
This includes a new transform called RedRable which will be
responsible for subsampling (and upsampling) images (the proper place
for this is already commented in the code).  Eventually, when I get
time (or someone contributes the code :) this class will do "the
correct" thing and blur before subsampling the image if image
rendering quality is set.

    The other option this change will make available to you is using a
multi-resolution source for your raster data (which will already have
the properly blurred/subsampled versions of the orginal image).
Personally, I recommend you use a multi-resolution source for
performance reasons, but eventually the RedRable may do what you need
with the proper rendering hints set.

AS> We would appreciate any clarification regarding image scaling
AS> quality within Batik - will Batik ever use JAI?

    I doubt Batik will ever require JAI, however the image rendering
path is already highly compatible with JAI.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org