Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Mozilla The Internet

Mozilla M16 Gets Alpha Channels 104

Snorfle writes: "In the recent Mozilla status update, there's a mention that real 8-bit alpha-channel support went quietly into Mozilla last week. Web-publishing types have been crying for this feature, provided principally through (royalty free!) PNG, though other alpha-capable formats will work too." All I want now is anti-aliased fonts for christmas.
This discussion has been archived. No new comments can be posted.

Mozilla M16 gets Alpha Channels

Comments Filter:
  • There bug report has a nice Unicode page [f2s.com] where you can test this bug.
  • The OP said that the Gimp had no efficient anti-aliased font rendering. Mind you font rendering in the Gimp usually conists of about three words, which takes all of about 100ms, no matter how inefficient the algorithm.
  • I've antialiased fonts installed (copied over from windows), and that made Netscape look somewhat better, but for some reason, it still looks worse than windows, and some fonts are still hideous.
  • i quite like them and the super portability of animated gifs makes them an atractive format

    with the bounding box nature of them they are quite compact too.

    Lame homepages will always be lame but good homepages use the available technologies to enhance the experience, animated gif's being part of that.

    Flash is good but proprietry and requires plugins.

    Animated gifs display in image browsers.

    We need unencumbered and supported animated file formats just as we need unecumbered static formats.

    The work being done on SVG looks good as it supports vector graphics with animation and createable with xml, can't get much more portable than that!

    http://www.w3.org/Graphics/SVG/Overview.htm8

    or here [w3.org]


    .oO0Oo.
  • I think its important to remember this just is another headace for us webdevelopers. I cant think of a client that would accept a crappy look in IE, and that is what ull get in most cases if you use this feature.. more serverside work is needed, great.

  • PNG is one of the most under-implemented formats out there. The format itself is very powerful, but good luck finding programs that support its full feature set. And it's not even a problem like that of TIFF, where the full spec is so huge that it's effectively impossible to implement the whole thing. The problem is that the software producers just haven't put a priority on it. I've been waiting so long for full alpha support that I'm actually somewhat surprised to see it finally showing up. I guess that's the kind of thing that you'll get from a nerd-oriented development model.

    Unfortunately, since I much prefer IE in general, I'll still have to wait a while to get alpha in my browser. Maybe Microsoft will figure out that Alpha is a Good Thing soon?

  • by Ed Avis ( 5917 ) <ed@membled.com> on Saturday May 20, 2000 @09:11AM (#1059439) Homepage
    Algorithms can't be patented in the UK

    Well.. unfortunately it's not that simple any more. Although the European Patent Convention specifically excludes [european-p...office.org] software from being treated as a patentable 'invention', the European Patent Office ruled [european-p...office.org] that this didn't mean what it said, and computer programs can be patented after all. It just goes to show that patent offices will try as hard as they can to increase what is patentable, without concern for whether such patentability is desirable. The EPO seems no more trustworthy than the USPTO. Following the EPO's decision, the UK patent office has revised its practice on software patents.

    Anyway, it is still not certain whether such patents granted are actually enforceable. The European Commission are considering changing the law to catch up with the EPO's behaviour, so that software patents will become officially permitted (rather than de facto permitted as at present). Until then it isn't certain whether a lawsuit based on a European software patent would succeed (IANAL); big companies such as IBM are however stocking up on software patents in the hope of one day being able to use them. (Have a look at freepatents.org [freepatents.org] for more about stopping this from happening.)

    Unisys claim to have a patent on LZW in several European countries, including the UK. I don't know whether they've actually tried to shake down British companies for money though. But you may not be as safe as you think.

  • Have you looked at any of the non-microsoft UI's lately?

    It is scary how almost NONE of them use the standard widgets. Look at any recent version of McAffe virus scan. It looks crazy. (I am not talking about high-end products here... just products for the general consumer.)

    It is kind of funny. On the unix side, we strive to have a uniform look and feel. On the windows side, everyone wants to be different.

    -- Thrakkerzog
  • just read in a other comment that its supported in IE 5.5+.. hurray.. headace over..

  • I'm shooting (pun intended) for at least 50%.

    :wq!

  • It seems that if the feature is coded, it isn't turned on, atleast in the latest nightly.
  • Netscape Navigator has actually had a very weak and undocumented version of alpha channels since at least NS 3.0

    The way it works is: Take a gif, double its resolution, then overlay a checkerboard pattern of transparent pixels. Then, create a page with that picture, halving the pixel dimensions so it's compressd down by NS. In most version sof NS 3 (And I believe IE3) this will actually create a 50% non-dithered alpha channel, letting the background show through.

    You can see an example of this here [fury.com], but be warned that it doesn't work on all browsers. There should be two copies of the same image. the first, reduced by 50%, the other full size. Note that on NS 4.7 on Linux the first doesn't show up at all. Elsewhere, YMMV.

    Kevin Fox
  • Check out www.icab.de, their browser has supported the alpha channel in PNG images for months, as well as anti-aliased fonts (part of the Mac window toolkit). Is it just me or are there too many OSS users out there that have stopped keeping up with other platforms, and so are really impressed when some piece of old tech makes it to linux?
  • More notes on alpha channels :

    Without alpha channels you cannot composite an image onto a background without a "pixelized border". With an alpha channel the edges of one image can be smoothly faded into the background image. Alpha channels are especially useful in games. Things like smoke/fire are not solid objects they are transparent and they fade out near their extents. To achieve this gradual fade out the alpha channel goes from 255 (or 1.0) in the center of the image to 0 near the edges.

    Also, "Alpha Buffers" are slightly different from "Alpha Channels". When drawing to a frame buffer with an Alpha Buffer the alpha values from the source image are usually copied along with the RGB components. In 3d games this is useful for drawing transparent shadows for objects. Without this, you can only draw solid black shadows or have a weird looking shadow.

    - First the object is projected onto the ground.
    - The screen area where the shadow is to be drawn is cleared in the alpha channel.
    - The object is drawn with updates to the RGB channels turned off (i.e. only the alpha channel - also called a stencil buffer - is updated).
    - A flat polygon is transparently drawn to the frame buffer where the alpha value is not 0.

    The result is a transparent shadow that doesn't overlap itself and get darker where polygons intersect.

    On the playstation 2 and several new games truecolor is used. Since 24bit color is difficult to address (requires multiply by 3 or X*2+X) 32bit is usually used. This gives 8bits left over for the alpha/stencil buffer. All sorts of neat tricks can be done with an alpha buffer. I've used it on the PS2 to do depth of field (i.e. distance objects look blurry) rendering without having to draw my scene more than once.
  • ---
    Nah. Almost all Be developers came from the Amiga world... They just targetted Mac users...
    ---

    Well, I know that Be has a larger than usual number of ex-Amiga developers, but I'd still say that most came from the Mac (at least, around the time I was heavily involved with the BeOS - between PR1 and R3 mostly).

    ---
    Have you ever seen CBM's "Amiga Style Guide" ?
    ---

    Nope, but I'd be interested in it. Is it available online somewhere?


    - Jeff A. Campbell
    - VelociNews (http://www.velocinews.com [velocinews.com])
  • by harmonica ( 29841 ) on Saturday May 20, 2000 @01:17PM (#1059448)
    There is a mixture of PNG and JPEG called JNG which is supposed to support JPEG compression and an alpha channel. But a short search on the PNG homepage [libpng.org] didn't bring any results for me. Maybe if you use a search engine.

    In theory, one can simply add an alpha channel to a JPEG file (a second channel for a grayscale or a fourth for a YCbCr color image) -- there is just no software that supports this. The JPEG standard also doesn't say anything about color spaces... Maybe one could wrap the alpha channel into a custom marker. This all makes sense only if it is standardized in some way (so that all major applications support it), which is a very painful and long process. But JPEG2000 is on the way, maybe it adds transparency support of some kind.

    I also know Kodak Flashpix, which uses JPEG compression, I don't know about alpha channel support.

  • I seem to remember that PNG specifies that the pixels should not be pre-multiplied.

    I don't remember what the reasoning for this was. I don't really understand what the problem is in what you are describing. Are you just saying that you have to be careful not to multiply twice? Or is there a fundamental flaw in non-pre-multiplied image data?

    It seems to me that the only problem is that losing some of the data to quantization, though it seems like it would go the other way -- pre-multiplied would degrade it.

    --Kevin
  • Well, they have the anti-aliased fonts, but I don't think they have full alpha-channel support for pngs (please do correct my if I'm wrong - I've only looked into this up until IE 5 - maybe 5.5 has better png support).
    --
  • If you are correct and PNG explicitly defines that pixels should not be pre-multiplied by Alpha then part of the problem should go away. They should blend correctly to screen; provided that content creators realize this means the color channel image of the PNG should not appear anti-aliased around the edges. Only the Alpha channel and the finished, blended image should have this quality. What you see is not what you get.

    You simply have to be careful not to multiply twice; multiplying twice means a pixel at 50% intensity is going to end up at 25% effective intensity in the destination.

    You can test this effect when blending white, antialiased text on to a white background. The pixels should sum at 1.0, perfect white.

    Quality becomes an issue only if conversions need to be made back of forth the two.

    Jouni
    --
    Jouni Mannonen
    3D Evangelist

  • To the "moderator" who labeled this as flamebait;

    this is another fine example of what is wrong with Slashdot and "Open Source" in general. Openness is more than about software. It's also about open opinions and free speech, another subject that many slashdotters love to spill endless comments over. If criticism is construed as flamebaiting, then what we have is the Web's equivalent of the Animal Farm, and Napoleon is a penguin.
  • i suggest reading this http://www.oreillynet.com/pub/a/network/2000/05/19 /magazine/mozilla_vm.html for a start and hold off your sarcasm.
  • by Anonymous Coward on Saturday May 20, 2000 @06:35AM (#1059454)
    True font anti-aliasing (as opposed to just gaussain blurring the edges of the font slightly, like windoze...) requires, at some level, an abstraction similar to an alpha channe.

    One simple (but imperfect -doesn't give enough attention to the destination image) implementation is (for monochrome fonts -colour fonts would require a colour alpha channel):

    an outline font is rasterised at high resolution, then this black+white high-res rasterisation is reduced to, say, a 16-level geryscale bitmap - which is used, somewhat like an alpha channel, to place the letter image on the screen

    eg. (somewhat contrived squat N shape -I
    can't be arsed doing any more manually) :

    High-res B/W rasterisation


    00 00 00 00 00 00 00 00
    00 11 11 00 00 01 11 10

    00 11 11 11 00 00 11 10
    00 11 10 11 10 00 11 10

    00 11 10 01 11 00 11 10
    00 11 10 00 11 10 11 10

    00 11 10 00 00 11 11 10
    00 11 11 00 00 01 11 10



    Lower res 4-greyscale image:


    02200121
    04341042
    04214142
    04300342


    This would then be merged, by
    whatever method gives a decent result (here
    a simple capped addition is used, more complex
    formula would give clearer result..),
    with the destination image, which is, for
    simplicity, here also a gresycale...


    Dest, Dest,
    before: after:
    01100200 03300321
    10100010 14441042
    00200000 04414142
    02110110 04410442

  • One other thing - I just downloaded the latest linux nightly build, and it really flies compared to earlier builds (I'm posting form it right now...), and renders 200+ comment slashdot in nested mode in a fraction of a second...

    You are right, this thing totally rips now. It is like a turbocharged browser. I like it a LOT. They also fixed the annoying one-back URL bar problem, and the X cut-and-paste, and SFGate front page renders properly...

    This seems like things are finally cooking. I really can't believe how fast /. loads.
  • The adblocker code is going to be largely irrelevant, just forcing people to pull their adserving machines back into their own domains. Whoopie. Somebody (doubleclick?) is even going to offer it as a trivial code drop-in that they will kindly manage and you are back at square one except that if you want to get around the adblocker you are going to have to get in bed with an ad agency and accept them touching your server.

    Since selling the ad cookie data is going to be part of people's income, doubleclick can just aggregate the code dumps into exactly the sort of profiling as before with exactly the same privacy implications.

    Your purchasing preferences are information, and like all other information it wants to be free too.

    DB
  • The previous threads indicated this would help with font anti-aliasing. How would an alpha channel help with text? Isn't this just for graphics?

    As has been mentioned by XFree developers, the most direct way to implement font (and everything-else) antialiasing is to have an alpha channel to use as a mask. So if Gecko now has proper support for 8-bit alpha rendering, it shouldn't be terribly hard to use this code to render masks to antialias fonts in browser windows.

    On the other hand, there is talk (again, among the XFree developers) of adding native server-level alpha channel support, which would make everybody's life easier in this respect -- plus, someone might finally be able to properly implement those silly transparent terminal windows. :-) More importantly, though, server level alpha support would make it much easier to render anti-aliased fonts, shaped windows, and such.

  • [GIF animations a]re as much a part of the web now as HTML. PNG needs animation support.

    There's always MNG [libpng.org], a superset of PNG that supports animation. And there's also JavaScript image rotation, which gives quite a bit more power than the simple rotation in the GIF format. But other than on banner ads (which are gradually moving to Macromedia Flash anyway), where do you see a GIF animation anymore? On somebody's lame homepage?

  • OMG!!! All the people slagging it off may actually be forced to admit that there's a point to Mozilla!!!!!
  • I think Mozilla is still using GTK. It's being used to draw the platform independant-ish toolmkit.
    treke
  • This is excellent news...however, a question...

    PNG uses a (albiet very good) losless compression format, similar to LZW or RLE. In my photoshop saver, it also has a number of extra filter options for adaptive sampling and dithering, to decrease the size in a lossy manner. However, I am willing to bet that the compression ratio on larger images isn't nearly as good as JPEG for photographic, non-flat art images with lots of detail, where every pixel is a random value.

    What I always wanted was an addition to the tag in html where you specify an identically sized greyscale JPEG as your alpha channel, so that img tag loads two jpegs, one with fill, one with alpha, since JPEG doesn't support alpha channels (it should.)

    is there any other format that supports jpeg compression and alpha channels? (besides .PSD, which was never meant for -really- small file sizes...)

    Also, what kind of keying is it doing? Is it premultiplied over black or straight? It's harder to avoid the fringies on normal images when keying straight, you have to overfill areas with solid colors and key inside those areas so that there's no black bleed on the edges.

    The JPEG hack may seem like a pain to most, but I work in television graphics all day long and we use a lot of seperated alpha/fill elements, in both custom hardware and desktop software, like After Effects, for reasons of control and flexibility.

    I'd like to hear people's thoughts on this.

    ---Mike
    harlock@raindrop.com
  • If you want MNG, someone has to pick up the ball and run with it, as no-one on the team at the moment has the bandwidth to take it on. See this bug [mozilla.org] for the full story.

    Gerv
  • by Anonymous Coward

    Animated gifs display in image browsers.

    Hmm... Maybe it's time for a GIF-Animation-to-ASCII-Art-Animation-converter-plu g-in for lynx?.. :-)

  • ...and what portion of your comfortable western existence will be paid for with the blood of screaming children? whose parents have no vote? in a country where there is no right to dissent?
  • I realize this has nothing to do with alpha channels, but since the day the Mozilla project was announced, there's been one change I've been lobbying for and I'm trying to round up additional support.

    In Netscape 0-3, when you opened a link in a new window, the Go menu retained the history of the old window. This changed in Netscape 4, where the new window now starts with an empty history. I find this incredibly frustrating. At a large site, I'll frequently open multiple windows, close them as I read the articles, and then discover that I can't back out because I forgot which window was the parent.

    After months of debate, a Netscape employee marked the RFE as "WONTFIX". (It seems to have recently been reopened.) If other people think this would be a useful change to make, please visit the relevant Bugzilla page [mozilla.org] and comment or vote!!
  • Not really - I generally avoid the Windows side, and feel no compelling reason to defend it (last I checked, you were right - UI standards are lacking there).

    On the Unix side, things have traditionally been terrible from the consistancy standpoint. But at least progress is being made. Microsoft on the other hand doesn't have any excuse - it's hard to impress on developers that virtues of a consistant UI when even similar Microsoft apps are completely different.

    I personally come from a MacOS background (bet you couldn't tell :>), whose main source of influence - Apple - has had a long history of pretty good UI design. The developers, with few exceptions, have been pretty good as well. Admittedly Apple really screwed up with QuickTime 4 and (even moreso) Sherlock 2, but it looks like they might be shaping up even if just a little bit.

    BeOS has had a pretty consistant UI between apps, even though it took some time before Be published their UI guidelines. That may have something to do with almost all original BeOS developers coming from the Mac world.

    As I mentioned, Unix/Linux seems to be getting better as well. With each release of Gnome and/or Sawmill (and the impending release of Eazel's stuff) I feel less shock upon rebooting into my LinuxPPC partition. I can only hope this trend continues, and developers learn the need for truly intuitive and user friendly interfaces.

    - Jeff A. Campbell
    - VelociNews (http://www.velocinews.com [velocinews.com])
  • Um, how exactly is a yet-to-be-released browser going to over take IE?

    Have you even seen the stuff that's in IE? And by the time mozilla comes out there'll be more.

    I've never managed to get mozilla working for longer than 20 minutes straight...including the NS6 preview.
  • by Kyobu ( 12511 )
    Flashpix is actually a pretty cool format. It allows zooming and very good resolution (good enough to print), with fairly small filesizes. Unfortunately, it requires either a plugin or a Java applet, and the plugin is impossible to find. Plus, it doesn't even exist for Linux browsers. The Java applet kinda works on Netscape, and doesn't work in Mozilla M15. The GIMP can't read the format, and I'm not sure if Photoshop can, either (at least, without a plugin). It's too bad, because it's pretty nifty. Take a look at Phil Greenspun's [photo.net] page to see how FPX can be used well.
  • Windows *does* anti-alias correctly over non-uniform background (ie. it really blends the pixels properly). Please do your research first. :) The screenshot [berlin-consortium.org] demonstrated alpha transparency, not anti-aliasing (or if it did, it's really horrible kind of!)
  • Instead of a manual or semi manual hinting evolver, how about going one better and designing an algorithm that can evolve a "most similar looking" shape for any outline font at any pixel size? Thereby removing the need for predesigned hinting at all.
  • If the main issue keeping X/Mozilla/Gtk etc from having decent antialiasing is a good set of TrueType fonts, please note that both MS and Apple make their base font sets available for free download.

    MS has their web font set available to provide a common user experience in all browsers and platforms. - If I recall correctly these may even be distributed by anyone assuming they use the MS "packaging". (Unusual move for MS, but this is when they introduced fonts like Comic Sans and Netscape was still the dominant browser. - They wanted to "enhance" the web by adding a common set of fonts beyond the basic Serif and San Serif varieties)

    Apple has released System 7 software for free download on their website. These systems include the common MacOS Truetype fonts. (Times, Helvetica, Courier are included) Apple's two fork file structure complicates things but not too much.

    I think free beer fonts is something I can live with. They're not such an essential part of the OS that they have to be hackable. - I'm also betting that all dominent distros could receive permission from Apple to bundle these already free fonts on their CD making install/setup easy for everyone.

    Success of Linux on the desktop depends on features... - I give Linux an 18 month window of oppotunity to proove itself on the desktop, after that people will ignore it. After said time, if we haven't made an impact, the market will see the desktop as a WinMe vs. MacOSX world. (Yes, we'll still be using Linux on our desktops but y'all know what I mean by desktop OS.)

    The real killer for Linux though isn't going to be pretty type. With broadband coming up, streaming media is going to be the killer app.
  • It's Phil's site where I for the first time really saw FlashPix used ;-)

    For FPX support on Linux, Image Magick [imagemagick.org] seems to have read support and it is supported by JIMI (Java image file I/O library) and JAI (Java Advanced Imaging). I have some FPX codec source code from JAI that I want to look at when I have some time left.
  • Mozilla's user interface isn't all that speedy yet; but it's important that the main feature of a web browser, page rendering works and works really fast. That's what matters, right? Please remember current Mozilla is still pre-beta. They still have all the debugging code bloat in it! There are versions of Mozilla that don't use it's own widget set (controls in Windows speak, gadgets in Amiga speak) for UI, which have *much* faster response for user interface events. IE is going to get run for it's money from Mozilla project.
  • Works fine in Netscape 4.61 for OS/2
  • by Anonymous Coward
    or gamma rays?

  • or at least the Microsoft equivalent anyway.

    For what it's worth (possibly not much to anyone here I realize, but hey, you don't get much Microsoft news so what the heck)
  • by luge ( 4808 ) <slashdot@DEBIANtieguy.org minus distro> on Saturday May 20, 2000 @05:46AM (#1059477) Homepage
    Prior to the actual milestone release, Mozilla tends to say that they are adding to "Mx" even though that milestone may not be ready for a while. M16 is supposed to be done by the end of next week, but who knows...
    ~luge
  • by Foogle ( 35117 )
    I don't know if the editor was refering to X11, but Mozilla should, theoretically, be able to use Anti-Aliased fonts already. If I'm not mistaken, GTK has anti-aliased font-writing to it's canvases, yes?

    -----------

    "You can't shake the Devil's hand and say you're only kidding."

  • Internet Explorer has supported this well since version 5.0.

    On another point: isn't it the OS's duty to create the anti-aliasing in fonts? It was done in Win9x with a simple checkbox in the Effects preferences and affected all display of fonts.

    I would imagine that the GIMP already has this built in; can't the code be propogated to the X codebase?
  • I totally agree with you that we need openness and criticism, but I think you are working from the assumption that all criticism is valid in any shape or form. This is not the case. There is a difference between constructive criticism and flaming. If the person wanted to make a good argument then she/he would have made a statement and provided some points to back it up. Instead, the person seems to be sarcastically attacking mozilla and providing no supporting statements. Hence, I think a moderation of that post as "flamebait" is valid.

    There is no place for ad hominems, insulting sarcasm, and deliberately hurtful words in open discourse. Otherwise, I could argue something totally horrible and irrelevant like, "you're wrong because you're gay and you fsck your father" and that would be protected under the guise of "criticism."

    I welcome constructive critism and differing points of view. I eschew and reject any other kinds of critisicm or negativity, and I do not think they belong on Slashdot.

  • Check this, it's done in Windows using standard GDI. Font anti-aliasing [geocities.com]
  • by CMiYC ( 6473 )
    Was M16 released? Or was support slipped into the nightly builds?

    ---
  • by Simm75 ( 189549 ) on Saturday May 20, 2000 @05:50AM (#1059483)
    I would assume that the editor was referring to X11 also. Antialiased fonts on the GTK caanvas object are fine, yes, but the caanvas object does little to improve font appearance in Qt. :^) There has been a recent proposal to add antialiasing to X11, among other things. This to me is The Right Thing To Do(TM). As a consequence of the antialiasing you refer to being GTK-specific, this does little for Mozilla (or at least pure Mozilla). Mozilla moved from GTK to a platform-independent-ish toolkit a while back. :^(
  • It's harder than you think. It's being worked on.
  • This means that a PNG can have varying levels of transparency. So a PNG of a penguin with a fuzzy shadow behind it will look beautiful on both black and white backgrounds. (Assuming you find penguins beautiful)

    I'm going to have to let go of the bitterness... I assumed it had been given up. Yay!
  • Agreed, the autocompletion, back and forward history and support for the wheel mice makes much better than Netscape Communicator.
    Thanks guys.
  • by ESD ( 62 ) on Saturday May 20, 2000 @05:55AM (#1059487)
    Most computerized images have 3 'channels' (red, green and blue). The alpha-channel is an extra channel of information, usually used for transparency information, so this means that images can have 256 levels of transparency in them, instead of the 2 that GIF uses.
  • Yeah, but the Mozilla group doesn't appear to have any qualms overriding the OS when they feel like it (hence the lack of native widgets - so much for platform consistancy).

    Are you high?

    To me platform consitency would mean it looking the SAME on most platforms. When I load mozilla on NT it pretty much (minus the window manager) looks the same. that is pretty friggen consistant. Get your head straight and stop dissing a project you most likely know nothing about really.

    Tony

  • Yes, specifically that it's the poster child of open software. If you want a complex project done right (and that includes everything, including Linux), then you're better off using conventional means.
  • Mod this up, because I love people who post cool comments (with binary examples, no less!) like the one above this without even bothering to log in.

    Seriously, the people reading at +2 should be able to read this, it's well done.

  • Weird way of getting attention to a bug. Anyway, you can vote for bugs [mozilla.org] in Bugzilla to mark most important bugs to fix. So far this bug has only got one vote but I also don't think that Slashdot effect should be used to emphasize one bug over others. Just make a search [mozilla.org] to find other and more fatal bugs.

  • Sorry, but Windows doesn't certainly do Gaussian blur or any other simple trick. It correctly renders anti-aliased fonts with TrueType hints. As much as we love to bash Windows, give credit where it's due.
  • by Mike Shaver ( 7985 ) on Saturday May 20, 2000 @07:37AM (#1059493) Homepage

    I'm not really concerned about polka-dotted scrollbars either, but there are some other areas where platform widgets tend to fall down (especially current GTK, as it turns out), and some of those are pretty important. Things like variable opacity for input widgets (this whole article is about variable-alpha, right?) and support for mixed font sets in input widgets (key for decent i18n support). The GTK i18n stuff is being improved dramatically by the Pango [pango.org] project, but it's not ready to deploy yet.

    Pluggable toolkit support is broken in M16, but will be repaired, and it then might be possible for you to build your own libwidget_darchmare.so that uses all-native stuff. I'm not really expert on the widget-construction code.

  • Isn't it past your bed time.

    Well at least you act like it.
  • Well, I have not seen it yet, but I once made a website where I wanted the buttons to be slightly transparent on the edges, so there would be a nice smooth transition from the button to the background.

    With GIF transparency, this was not possible in a reasonable way, because either a pixel has to be fully transparent, or fully opaque (i.e. completely solid), so you can't have a pixel which is 25% transparent for example.

    If I had the possibility to use PNG files (which offer 256 levels of transparency), the transition would even have been smooth on a low-resolution display.

    So it has its uses, especially for images which have to blend into the background, or maybe into another picture (hmm.. is this possible in HTML?)
  • Here's a nice demo:

    http://www.pp.htv.fi/hsivon e1/css-test/bitmapstyle.html [pp.htv.fi]

    View the source. Check out the PNG in the GIMP. very cool.

  • Works fine on Netscape 4.5, on Solaris...
  • I'm not really sure, but couldn't the changes be made to GTK/QT so that all GTK/QT apps supported it without recoding? (Of course more "native" X apps is another issue)
  • Mozilla has a project to get SVG into the browser. Can't recall how far along they are, but there's a link from the Mozilla Projects page.
  • there was once something called JPIG which was essencially jpeg with an alpha channel. as far as i've seen (never heard of it since) it hasn't taken off. it required a plug in i think - which is a bad start.

    it's something we could do with.

    and maybe animated pngs to replace anim gifs. not that i like them - by they're ok when used properly.
  • Supposedly, that is not true AA in win9x. (They didn't even have the gall to call it AA.) That is why they called it "Smooth Edges" instead of AA.

    You can tell it is not AA by looking at fonts which have been scaled very small.


    -- Thrakkerzog
  • I didn't make it actually. But like I said everything you need to know to do it is in the source and the image.

  • by Jordy ( 440 ) <jordan@NOSPam.snocap.com> on Saturday May 20, 2000 @11:45AM (#1059503) Homepage
    Antialiasing font rendering is something that has existed in at least Freetype for some time. However, antialiasing is fairly worthless without decent fonts to begin with. Microsoft and Apple both have manually hinted fonts which have been adjusted to look their best at the most common point sizes. There are very few people on this planet which can do a really good job manually hinting fonts and it's a very long process.

    Fonts are one of those things which have very interest protections under the law. You can legally copy underlining font outline out of a font without violating any copyright laws, however the hinting is actually a set of assembly-like instructions embedded into the font which are covered under US law.

    Until someone sits down and spends a year manually hinting things like Arial/Helvitica and open sources the hinting instructions, other OS's are doomed to deal with overly thick verticals, misaligned letters and misshaped ovals.

    Of course, someone who really wants to be clever can install FreeType (with the old hinting engine which will process the manual hinting correctly) under Windows and create a program which evolves your own font's hinting until the output looks like the Microsoft font output at various sizes w/o aliasing turned on. The basic idea is you render the 'M' at size 36 from Times New Roman with FreeType then you import the outline into your own font file and continually change the hinting instructions until your 'M' and the Times New Roman 'M' are the same when compared pixel by pixel. You wouldn't be copying the hinting instructions, you'd be creating your own and automating the process of checking it against the original.

    That would make an interesting PhD thesis.
  • I believe there is a Python program by name of TTX (?) that does this... or something similar. It's worth crawling 'round for -- search "Python TTF XML", perhaps (same page also had a tool for rendering TTF to XML and back...)

    --
  • People DO have a right to express their opinion, even if it's right or wrong...

    --bdj

  • Score: -5, Posted by complete idiot. You loser. More people have died from Christianity than from Communism. Yet Christian companies like Wal*Mart do well in America. What's your explanation for that?
  • Thanks, that's what I thought they meant, but I wasn't sure.

    The previous threads indicated this would help with font anti-aliasing. How would an alpha channel help with text? Isn't this just for graphics?

  • Also, what kind of keying is it doing? Is it premultiplied over black or straight? PNG defines it as "straight", ie the way you would composity A with alpha a over B is to do A*a+B*(1-a).

    Premultiplied over black means you do A+B*(1-a).

    Premultiplied has some advantages: you can make glows (where A > a), programs that ignore the alpha produce an ok image (rather than strange bright colors on the antialiased edges), and all 3-D renderers produce this type of image. Premultiplied images should compress better too, due to the coherence between intensity and alpha.

    Premultiplied has disadvantages, too: the color of transparent areas is at a very low resolution (this will show up if you overlap the same color many times), you can't get two antialised images that overlap without unexpected seams due to this, and if you pull a key you have to destroy information that may be useful for making a better key. Also the 3-D renderers are almost always incorrect with the math because they assumme the gamma is 1.0 and removing this assumption is difficult or impossible.

    It would seem to me that PNG should have allowed a flag to say which way the image is stored, but they probabably wanted to keep it as simple as possible. Except for glows you can convert premultiplied to non-premultipled by dividing by the alpha (use 0 if the alpha is zero).

  • by Anonymous Coward on Saturday May 20, 2000 @06:02AM (#1059509)
    Maybe it can, but I just took a screen grab and
    inspected it real close - and no antialiasing was evident.

    There is no standard way of doing font antialiasing in X - and I suspect that the way the Gtk-antialiasing works is rather high-bandwidth, andonly works with certain outline fonts, although I haven't looked into it - I suspect it renders the glypghs with an internal library, and sends them as full bitmaps - rather intensive...

    The KDE crowd are proposing an extension to the X server to handle Font antialiasing, rather like GLX or DPS, but many existing applications would have to be recoded to take advantage of it (although applications using only Qt or Gtk calls should be fine, since that's another layer of abstraction)

    Why? Because in the standard X protocol, font glyphs are defined as 1-plane bitmaps. Black and White. Any antialiasing done to them at that stage just blurs the font a bit - to do proper font antialiasing, you have to produce a multi-level brightness map of the font, and merge it with the existing graphics - i.e. it has to be a two-way interaction for true antialiasing. The current X protocol makes no provsion for that, so a protocol extension would be necessary. Another thing - make provision for multicolor fonts in the protocol extension, guys! (i.e. do _colour_ antialiasing on colour outline fonts (there aren't many yet (epson supply a few with their printers), but they exist).

    One other thing - I just downloaded the latest linux nightly build, and it really flies compared to earlier builds (I'm posting form it right now...), and renders 200+ comment slashdot in nested mode in a fraction of a second...

  • but many existing applications would have to be recoded to take advantage of it

    No, if it is done right unchanged applications will draw antialiased fonts. There may be some requirements: they must use a TrueColor visual, the bitblit must be Copy, they must select a font that is actually an outline font, etc, but many applications will already satisfy these requirements.

    I think any solution that does not make old applications work should not be accepted, ie we don't need another "extension" for this. Even MicroSoft did their anti-aliased font interface correctly, ie "old" applications got it with no rewrite.

    The interface to the font storage in X does need to be rewritten, and here I recommend that the implementors go totally ape and rip out ALL the old crap. There is no reason to support any of the old font servers.

  • >What I always wanted was an addition to the tag in html where you specify an identically sized
    >greyscale JPEG as your alpha channel, so that img tag loads two jpegs, one with fill, one with
    >alpha, since JPEG doesn't support alpha channels it should.)
    >
    >is there any other format that supports jpeg compression and alpha channels? (besides .PSD,
    >which was never meant for -really- small file sizes...)

    Yes, JNG (JPEG Network Graphics, a part of MNG)
    supports a JPEG image plus a PNG-encoded alpha
    channel.

    Look for the JNG specification at
    http://www.libpng.org/pub/mng/
  • Although JPG animation is more interactive and flexible (see: http://www.exmet.com/exmet.php), it has load time problems if using numerous images. With browsers that request 4 or 5 images at a time it take a while to load 100 jpgs, while a animated gif is a single file transfer from the server. Sad but true. With Stylesheet support, you can combat this by downloading a multiframe JPG then just show parts of it, but this also introduces issues and restricts your browser audience. Its another two-edged sword. -- Moxy.
  • Internet Explorer has supported this well since version 5.0.

    There are a few areas where Netscape dropped the ball over the last few years; fortunately, though, we seem to be catching up at quite a rate.

    IE 2 was pretty crappy, NN 2 was just a bit primitive.

    IE 3 was really quite usable, for the time. Interestingly, it seems to have been created in a similar way to the approach IBM took with the PC: take a very small, good, dedicated team, and get them to produce something very quickly. It worked in both cases.

    By IE 4/NN 4, the tables had turned; IE was in the lead.

    Now, though, Mozilla looks set to reverse the roles again: it's certainly not perfect (hint: DO NOT MODERATE ON /. while using it - I did, and it ate my points!) but it's going to be amazing once the bugs are fixed and the performance has been tweaked!

    Things like the ad-blocker should be killer features, with a bit of work (I note the /. people have already changed things to make ads come from images.slashdot.org...).


    On another point: isn't it the OS's duty to create the anti-aliasing in fonts? It was done in Win9x with a simple checkbox in the Effects preferences and affected all display of fonts.

    That depends what you mean by OS. If you have a watertight definition, I know a DoJ who want to meet you :-)

    Seriously, it really belongs in the font rendering sytem (well, duh!). That's where XFS (the X Font Server) comes in. Unfortunately, there are various problems in this area (this was discussed on the wine-devel mailing list a year or so ago, IIRC) but I think it can be done with some patches.

    Incidentally, I am told the Win95 `font smoothing' isn't true anti-aliasing: all it does is smudge the font slightly!

  • Comment removed based on user account deletion
  • "If I'm not mistaken, GTK has anti-aliased font-writing to it's canvases, yes?"

    If you're talking about the GNOME canvas then no.
    The gnome-canvas-text item is majorly screwed in antialiased mode.

    It is possible to do it by creating a custom widget that draws what freetype creates though.
  • by Anonymous Coward
    There are apparently some KDE hackers just started work on it - but it will not automatically enhance all applications using X Fonts - only new applications will benefit. But yes, it will be a plug-in extension like DGA or GLX, and no, it won't break existing applications - they'll just look worse than ones using the extension...
  • Comment removed based on user account deletion
  • ---
    Are you high?
    ---

    Nope, although I've probably got enough caffeine in my system to kill a horse. I doubt that's making a difference, though.

    ---
    To me platform consitency would mean it looking the SAME on most platforms.
    ---

    Umm... Most people who use a given OS use it exclusively, or mostly so. Even if they don't, it's a good bet that they are intimately familiar with the widget set and capabilities of the operating system they use most of the time. Why should we diverge from accepted user interface standards? Should we return to the day when each application had its own user interface? I hope you're not seriously considering such a movement.

    ---
    When I load mozilla on NT it pretty much (minus the window manager) looks the same. that is pretty friggen consistant.
    ---

    But, it's not consistant with the rest of NT. It's certainly not consistant with the MacOS UI. If you install something that performs global changes on the UI (ie. Various themes [themes.org], Kaleidoscope [kaleidoscope.net], etc) then those won't work either. At the very least, this is a pretty blatant duplication of code/effort. At its worst, it's externally inconsistant with the rest of the OS. Bad UI design.

    ---
    Get your head straight and stop dissing a project you most likely know nothing about really.
    ---

    Actually, I do know a bit about the project. I've even done some early work on one of the more popular skins that you can use with it. Check MozillaZine's ChromeZone if you'd like.

    Perhaps you should refrain from commenting on something (or in this case, someone) you know nothing about?


    - Jeff A. Campbell
    - VelociNews (http://www.velocinews.com [velocinews.com])
  • Oh, look Mabel! Our little Johnny is growing up and starting to become politically aware. How cute.
  • I've read/heard all of this before, mostly in the Mozilla UI design newsgroup. I'm pretty familiar with the arguments.

    However, when pressed, the main Mozilla folks will blame it on lack of funding for native user interfaces. I'm not sure how designing custom UI widgets is more cost effective than using native UIs, but if this is true then the blame goes to AOL for letting their lack of funding ruin the direction Mozilla's UI has gone.

    If they don't want to fund it, don't. At least it won't sully the name of Mozilla with a usability nightmare of a user interface.

    Besides, the whole "Web browser as a platform" story is a joke. Frankly, I'd much rather have a decent web browser first. As much as I respect the O'Reilly people, they sure picked the wrong thing to compare Mozilla to. Java apps are notorious for less than acceptable user interface design (yes, even w/Swing).

    And no, I'm not talking out my ass. :> In fact, the article you reference even links to a skin [alphanumerica.com] that originated from yours truly (since taken over by a very talented guy by the name of Pete). So yeah, I'm somewhat familiar with the technology behind Mozilla's skins/chrome.


    - Jeff A. Campbell
    - VelociNews (http://www.velocinews.com [velocinews.com])
  • Anyone who wants quick, easy, portable, non-resource-hungry animations which degrade well to older browsers.

    I was forced for a long time to use browsers which lagged a long way behind the state of the art. This made me sympathetic to the needs of other people who are stuck with older technology. There's nothing quite so frustrating as trying to find a piece of information only to continually run into dead ends in the form of messages like "Sorry, you need a frames/javascript capable browser to view this page".

    Okay, so many animated GIFs are really unnecessary but sometimes a bit of animation can really make a site. Check out http://www.digger.org [digger.org] for example. When creating this animation, I looked at many ways of doing it and picked the way which would download fastest and work best of the widest range of browsers.

    I know many people dislike GIFs for ideological reasons (i.e. the Unisys patent) but for those of us that don't live in the USA - we don't care! Algorithms can't be patented in the UK so I'll use GIFs on my web pages for as long as they can be viewed by the greatest proportion of web users.

  • Mike -

    Thanks for the info. Have any 3rd parties (ie. Apple - I can't imagine Microsoft doing so) expressed interest in working on native UI widgets? I'd be very interested in seeing it happen.

    Perhaps with Fizzila on OSX...?

    - Jeff A. Campbell
    - VelociNews (http://www.velocinews.com [velocinews.com])
  • It's not a KDE hacker I don't think. It's someone at SuSE, if it's the same person I'm thinking of: Keith Packard, possibly.

  • Due to this bug [mozilla.org] in Mozilla, any web page that has a form and uses a charset that is other than ISO-8859-1 would not work. I hope the severity of this bug is increased ASAP and the fix moved to something other than M19. This bug is known to effect Unicode pages that have forms as well.
    --
  • Just because they're windows TTF files, doesn't mean they're antialiased... That's a function of Win98, not the fonts themselves.

    -----------

    "You can't shake the Devil's hand and say you're only kidding."

  • That's an old-school Slashdot way of being Cute(TM), but it's totally overused and mostly out-of-place... I like this place less and less every day.

    And before any of your retarded-monkeys tell me to leave (since I dislike it so much), let me save you the trouble and respond with a loud "eat me". Thanks.

    -----------

    "You can't shake the Devil's hand and say you're only kidding."

  • The difficulty in doing this is the whole reason hinting exists. Humans are still way better at this than any known algorithm.
  • Sir you are a liar. how can you tell from tcp packet that its a part of jpeg file ? englighten me
  • by Anonymous Coward

    There is no standard way of doing font antialiasing in X

    Correct.

    The current X protocol makes no provsion for that, so a protocol extension would be necessary.

    It's not the extension that's difficult to implement; it's the internal server support for alpha-blending. We'll want to use alpha-blending for many purposes (anti-aliased fonts, translucent blits, translucent windows etc.), and we only want to implement it once in the driver. So what is important is defining internal X server interfaces that are useful for a variety of extensions and still easy on the driver writers.

    As was announced some time ago on /., Keith Packard is working on a rendering extension for XFree86. In the process, he will doubtless implement all the internal interfaces needed. Once that happens, you may expect to see a number of interesting server extensions.

  • Excellent, when can you start coding? Or at least designing the concepts into a codeable specification?
  • By Alpha blending people generally mean multiplying every destination pixel by Alpha of the pixel to be blended, and the source pixel by one-minus-Alpha and finally add these two pixel values together. While this works fine for some things, it should be noted that anti-aliased images are actually done correctly with something called pre-multiplied Alpha in which the image's pixels represent the final color value after internal multiplication by Alpha.

    Using pre-multiplied Alpha you could, for example, render a 3D text logo on to a black background and save it with the Alpha channel, then blend to screen to get a perfect anti-aliased result on top of any color background. Using standard Alpha blending, you would see a thin dark outline on the logo where the already anti-aliased pixels - Alpha blended towards black in the rendering program - are darkened further by the process of blending.

    Traditionally, this is the reason why in some games a bright explosion might have darkened outlines; not because the artist thought it looked good but because digital image processing is a fairly intricate process and the logic of it is not always clear. Even the art guys don't always understand.

    Pixels in the image that are fully opaque (i.e. not transparent at all) would have an alpha value of 1.0 and would thus replace the one on destination. Pixels in the image that have only 50% coverage because of anti-aliasing, would multiply the destination by 0.5 but should not be multipled by the alpha internally because they were already rendered on to a black (00,00,00) background. Pixels in the image that are fully transparent would not affect the destination.

    The output of these two processes is fundamentally different and choosing between them requires knowing whether the color information in the image is already affected by the alpha information or not. You must do this decision explicitly, for it cannot be determined from the image itself.

    Whether there is a switch for this in Mozilla or any other Alpha supporting browser, or whether there is a switch for this in the PNG file format itself I do not know. My point is that there should be, if we're wanting proper output of our blended imagery. Jouni
    --
    Jouni Mannonen
    3D Evangelist

  • ---
    On another point: isn't it the OS's duty to create the anti-aliasing in fonts?
    ---

    Yeah, but the Mozilla group doesn't appear to have any qualms overriding the OS when they feel like it (hence the lack of native widgets - so much for platform consistancy).

    I guess they're trying to do the Anti-Microsoft. Instead of an OS swallowing up a web browser, damn near everything is going to be part of a browser. Next thing you know, they'll include a fully featured file browser and disk defragmenter in their next release...

    <SARCASM>
    But hey, at least it'll allow people to have polka-dotted CSS-compliant buttons and scrollbars! Forget good UI design, this is the kind of thing web developers need!
    </SARCASM>



    - Jeff A. Campbell
    - VelociNews (http://www.velocinews.com [velocinews.com])

Trap full -- please empty.

Working...