On Thu, Nov 12, 2009 at 12:57 AM, Brian Wang <brian.wang.0...@gmail.com> wrote:
> Hello all,
>
> I'm mainly using elementary as my GUI framework.
>
> I found that when ELM_ENGINE is set to x11-16, the icon images seem to
> be 'broken' and look pretty bad.
> I googled a bit and it seems that it is a known problem as discussed
> in openmoko project.
> There is a 'elementary-theme-sixteen' theme in the shr git, which
> claims that it looks good even with the x11-16 engine.
> I took a look at the images but did not know what's the magic behind it.
>
> Any tips on how to make a good looking theme for x11-16?
> Or is there an option (at compile time or run time) that will improve
> the rendering quality with just a bit of penalty in performance?
>
> Does x11-16 affect only the quality of images or it affects also the
> font rendering?

I really want to know screenshots of it. Really, Raster would know the
lack of dithering and blockier gradients because he has "eagle's
eyes", but generally you see minor glitches most people will not
notice. The biggest one so far is blending white on white, but I even
worked it around and it should handle this special case (giving you
white instead of green-ish gray).

For instance Canola2 use 16bpp which very colorful and rich visual.
Actually I wrote 16bpp engine for Canola2 project and designers were
always carefully checking all the details:

    http://openbossa.indt.org/canola2/

I'd recommend watching out rectangle colors that are supposed to match
image colors. Remember that 16bpp is RGB565, that is 5 bits for both
red and blue, 6 for green. So you basically discard the lower bits of
each full 0-255 values in 32bpp. But for images we apply dithering
when converting from 32->16 in order to avoid blocky gradients and
such, for those cases you will likely get different color (1 value up
or down) for each component based on nearby pixel.

The safest thing to do is to calc 16bpp colors using:

dr = (r >> 3) << 3
dg = (g >> 2) << 2
db = (b >> 3) << 3

The attached script should help you in your task.

Again, send some screenshots so we can know what you mean.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
#!/usr/bin/python

import sys

if len(sys.argv) != 2 and len(sys.argv) != 4:
    raise SystemExit("Usage: %s <color>" % sys.argv[0])

def parse_color(color):
    try:
        return int(color, 0)
    except ValueError:
        raise ValueError(("unsupported color component: %s, "
                          "use a valid integer value/representation.") % color)

def parse_from_tuple(components):
    if len(components) != 3:
        raise ValueError("components should be red, green and blue")
    r, g, b = components
    r = parse_color(r)
    g = parse_color(g)
    b = parse_color(b)
    return (r << 16) | (g << 8) | b

if len(sys.argv) == 2:
    color = sys.argv[1]
    if color.startswith("0x"):
        color = int(color, 16)
    elif color.startswith("#"):
        color = color.replace("#", "0x")
        color = int(color, 16)
    elif ',' in color:
        color = parse_from_tuple(color.split(','))
    else:
        try:
            color = int(color)
        except ValueError:
            raise ValueError(("unsupported color: %s, use either #rrggbb, "
                              "0xrrggbb or rr,gg,bb") % color)
else:
    color = parse_from_tuple(sys.argv[1:])

r = (color >> 16) & 0xff
g = (color >> 8) & 0xff
b = color & 0xff

print "Original color: %#06x (#%06x) (%02d, %02d, %02d)" % \
    (color, color, r, g, b)

dr = (r >> 3) << 3
dg = (g >> 2) << 2
db = (b >> 3) << 3

downcolor = (dr << 16) | (dg << 8) | db
print "16bpp color...: %#06x (#%06x) (%02d, %02d, %02d)" % \
    (downcolor, downcolor, dr, dg, db)
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to