Don't forget that pixellizing may be a very wanted feature when upscaling bitmaps or when upscaling filtered objects with FilterRes applied.

See also https://bugs.launchpad.net/inkscape/+bug/710639



De : Jasper van de Gronde <th.v.d.gronde@...528...>
À : inkscape-devel@lists.sourceforge.net
Envoyé le : Vendredi 29 mars 2013 13h37
Objet : Re: [Inkscape-devel] Different interpolation when upscaling bitmaps (was: C++ification of the SPObject tree)

On 2013-03-28 22:45, Josh Andler wrote:
> Hey Krzysztof,
>
> In speaking with ~suv, not unexpected, but of course there was an
> issue she observed and I think it's a problem. :) Basically it was
> with an unscaled QR code image that was imported and aligned to the
> pixel grid and then zoomed in on. Comparison screenshot
> http://dl.dropbox.com/u/65084033/irc/bitmap-sampling-screenshot-r12226-r12228.png
>  The left side is before Jasper's change.
>
> I did a test here on my end and yeah, it's definitely unexpected that
> it's increasing the antialiasing as you increase the zoom. Possibly an
> unintended bug, but if not it's a regression that's not worth the
> trade off imho.
This is basically just a choice, and completely expected (and quite
desirable in many cases). My code only deals with DOWNscaling, upscaling
is done using Cairo. However, while implementing this work-around, I
removed the check that set the interpolation to nearest when upscaling,
as I figured it might have been some weird work-around. I guess it was
probably put in to have "nicer" upscaling of pixelized bitmaps, but for
photographs it does not really make sense. Also, the standard
essentially suggests to use at least bilinear interpolation.

Ideally, we would allow users to set a rendering hint (like
shape-rendering) to decide what they prefer. However, there does not
appear to be a proper hint in the standard (image-rendering mostly
stresses the speed, but I guess it could be hijacked). Also, there is no
guarantee other renderers make the same choice we do. In general it is
probably a bad idea to rely on pixels being upscaled as flat rectangles,
as this is quite uncommon behaviour.

Still, since photographs and such are typically downscaled, I would be
okay with bringing back the old code. Or just remove the scale clamping
from my "hack". This will have a similar effect, with slight
anti-aliasing if the upscaled pixels do not fully align with the target
raster.


------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...842...rceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-devel