freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] GSoC - Image comparison in test framework


From: Werner LEMBERG
Subject: Re: [ft-devel] GSoC - Image comparison in test framework
Date: Mon, 06 Mar 2017 05:35:35 +0100 (CET)

Hello Arvinder!


Thank you for your interest in FreeType development.

> I'm interested in the project to develop a test framework and was
> trying to get a better idea of what the image comparison between the
> baseline and test glyph/image would involve.
> 
> As I see it, there are many different ways to go with the
> comparison.  A basic method might be comparing pixel-by-pixel, using
> for example the RGB or HSV values to look for and quantify possible
> differences. A more interesting method I came across included
> computing color/brightness histograms for each image and combining
> this with a measure of the texture of the image by performing edge
> detection on the images.
> 
> I was wondering what direction you wanted to go with the method of
> the comparison.  Is the goal to get a fast and simple measure of the
> differences between images/glyphs, with any basic method as
> mentioned above? Do we want a more robust method that works with
> rotations or scaling differences?

Neither `fast' nor `simple' is important IMHO.  The first step is to
check whether there are differences at all.  Currently, FreeType
already emits MD5 checksums for rendered glyphs if asked for, i.e.,
using the `bitmap' group and debug tracing level 3 or higher in the
`FT2_DEBUG' environment variable, for example

  FT2_DEBUG=bitmap:3 ftview ...

If there is a difference to a previous run, the changes should be
visualized.  It's one of the tasks in this project to find a suitable
way for that :-)

Checking rotation is not important – the rendering always happens
unrotated, and rotation gets applied afterwards.  Ditto for scaling
that happens after hinting (scaling before hinting is the same as
selecting a proper font size for the rendering operation).

Regarding size: The larger the size, the less critical rendering
differences are.  In other words, the most interesting range for
comparisons is between 6ppem and 30ppem.  At such small sizes, you
have to essentially check for pixel differences (in B/W mode) and
pixel brightness differences (in AA modes).

Typical examples of rendering differences.

  . A glyph isn't rendered at all due to an internal problem of
    handling the glyph's data.

  . A stem gets positioned higher or lower; this affects a series of
    consecutive horizontal or vertical pixels.  This is the most
    frequent – and most important case.

  . In B/W mode, a rendered structure has one pixel more or less.

  . In a string of glyphs, the gap between glyphs changes.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]