PNG transparency

T

Tom Anderson

You're correct - I loaded both into Photoshop, which says that the
doctored image is indexed (i.e. mickey mouse) color, and the other is
RGB color.

I believe there is a minor point of confusion here. Both of you are
contrasting some 'mickey mouse' with something proper - in Roedy's case,
alpha channel transparency, in Sherman's case, full colour. But note that
in PNG, these are *not the same*!

You can have a full colour image with alpha (colour type 6), or a full
colour image with no alpha but a special colour used to mean full
transparency (colour type 2 plus a tRNS chunk), or you can have indexed
colour with one transparent palette entry (colour type 3 plus a tRNS chunk
with one entry), or indexed colour with alpha values attached to as many
colours as you like (colour type 3 plus a tRNS chunk with multiple
entries). The single-transparent-colour indexed form is in fact just a
degenerate case of the alpha-channel indexed form.

The reason that indexed colour transparency works in IE6 but full-colour
transparency doesn't has got nothing do with alpha vs binary transparency,
it's just that its full-colour PNG decoder ignores alpha, whereas the
indexed-colour one doesn't (although it does round all nonzero
transparency to full transparency).

tom
 
K

Knute Johnson

Tom said:
I believe there is a minor point of confusion here. Both of you are
contrasting some 'mickey mouse' with something proper - in Roedy's case,
alpha channel transparency, in Sherman's case, full colour. But note
that in PNG, these are *not the same*!

You can have a full colour image with alpha (colour type 6), or a full
colour image with no alpha but a special colour used to mean full
transparency (colour type 2 plus a tRNS chunk), or you can have indexed
colour with one transparent palette entry (colour type 3 plus a tRNS
chunk with one entry), or indexed colour with alpha values attached to
as many colours as you like (colour type 3 plus a tRNS chunk with
multiple entries). The single-transparent-colour indexed form is in fact
just a degenerate case of the alpha-channel indexed form.

The reason that indexed colour transparency works in IE6 but full-colour
transparency doesn't has got nothing do with alpha vs binary
transparency, it's just that its full-colour PNG decoder ignores alpha,
whereas the indexed-colour one doesn't (although it does round all
nonzero transparency to full transparency).

tom

Tom:

That's the best description I've seen so far. I put up a couple of
images, one RGB with alpha and one indexed with alpha. I created the
RGB image with a TYPE_INT_ARGB BufferedImage and ImageIO. I used GIMP
to convert that image to an indexed PNG. The alpha should work
correctly on IE 6 for the indexed but not the RGB image. Also there is
a difference when the image is loaded directly or in a web page with IE.

The image is black with alpha of 0 and gray letters. The web page has a
light blue background so as not to confuse the usual white as transparent.

http://rabbitbrush.frazmtn.com/pngtest.html

If somebody has IE 5.5 or IE 6 and can send me a screen shot I'll put it
up for all to see.
 
R

Roedy Green

You have not been unwinding the saga of the "Fake Norma"?

I can see someone managing to create fake messages, but how did he
manage to get rid of the original, and how he replace it with a
message with the same ID.

There are so many much more useful things a person with those skills
could do.
 
J

Joshua Cranmer

Roedy said:
I can see someone managing to create fake messages, but how did he
manage to get rid of the original, and how he replace it with a
message with the same ID.

Complain to your ISP server (or which ever one in the chain doing it)
about supporting Supercedes: headers. I've noticed that my native ISP
newsserver doesn't honor it, but news.aioe.org (or a server between them
and the original poster's server) does honor it.
 
J

John B. Matthews

Knute Johnson said:
Tom:

That's the best description I've seen so far.

Tom: Yes, thanks!
I put up a couple of
images, one RGB with alpha and one indexed with alpha. I created the
RGB image with a TYPE_INT_ARGB BufferedImage and ImageIO. I used GIMP
to convert that image to an indexed PNG. The alpha should work
correctly on IE 6 for the indexed but not the RGB image. Also there is
a difference when the image is loaded directly or in a web page with IE.

The image is black with alpha of 0 and gray letters. The web page has a
light blue background so as not to confuse the usual white as transparent.

http://rabbitbrush.frazmtn.com/pngtest.html

If somebody has IE 5.5 or IE 6 and can send me a screen shot I'll put it
up for all to see.

Knute: I was going to try it at <http://browsershots.org/>, but I see
someone beat me to it!

<http://browsershots.org/http://rabbitbrush.frazmtn.com/pngtest.html>
 
M

Martin Gregorie

Complain to your ISP server (or which ever one in the chain doing it)
about supporting Supercedes: headers. I've noticed that my native ISP
newsserver doesn't honor it, but news.aioe.org (or a server between them
and the original poster's server) does honor it.
The Supercedes header only reports that replacement has happened - it
doesn't cause it. A compliant NNTP server is at liberty to replace an
article with a subsequently received article containing the same id - see
RFC 1036 and 3977.

The problem is that, while the CANCEL request will only cancel articles
that were originated by the original articles author or his NNTP
administrator, there is no corresponding restriction on article
replacement. Evidently those responsible for the RFCs didn't consider
malign uses of the replacement mechanism.
 
T

Tom Anderson

Could you have a look at the entry now, and suggest a modified set of
alias names for the two formats that you may encounter.

http://mindprod.com/jgloss/png.html#TRANSPARENCY

I wouldn't call mickey-mouse transparency 'indexed', since it's got
nothing to do with indexed colour (in fact, you *can't* use it with
indexed colour!), but apart from that, the names themselves are fine. I
also wouldn't use the word 'palette' in the description of it, since it's
used with true colour images, which don't have an explicit palette. You
could say it steals one colour from the colour space, but 'palette'
suggests the wrong thing to me.

Your description of IE6 behaviour is then the key thing that needs
changing. It's not that IE6 only supports mickey-mouse transparency: in
fact, it *doesn't* support mickey-mouse transparency (as far as i know),
nor does it support proper transparency for true colour images. It only
supports the combination of proper transparency and indexed colour.

The freaky thing is that for indexed colour, proper transparency involves
the tRNS chunk, whereas true colour does it in the pixel data, so in a
way, these are different. And the transparent indexed colour is
structurally more similar to mickey-mouse transparency with full-colour,
which also uses that chunk, despite working in a completely different way!
AAAARGH!

So, yes, it's *really* annoying that PNG treats true and indexed colour
differently. In a true colour image with alpha, a colour is represented by
four samples, packed together. In an indexed colour image with alpha,
there are three samples in the palette, and one in the tRNS chunk. Why not
in the palette? To avoid wasting space in alphaless indexed images, you
could define different colour types for indexed and indexed with alpha,
and have their palettes contain RGB and RGBA respectively.

This is compounded by the fact that the tRNS chunk is then used to mean
completely different things for true and indexed images: it holds the
single transparent pseudocolour for a true colour image, and a list of
alpha values to be tacked on the side of the palette for an indexed colour
image. I'd have made it consistent: make it a single pseudocolour which
indicates full transparency in all cases.

I guess the point of the current system, if this was a conscious design
choice, is that in an indexed colour image, the number of palette entries
with alpha can be smaller than the total number of palette entries: if you
have 256 palette entries, and just two transparent ones, you save a
whopping 254 bytes. Wow.

tom

--
Imagine a city where graffiti wasn't illegal, a city where everybody
could draw wherever they liked. Where every street was awash with a
million colours and little phrases. Where standing at a bus stop was never
boring. A city that felt like a living breathing thing which belonged to
everybody, not just the estate agents and barons of big business. Imagine
a city like that and stop leaning against the wall - it's wet. -- Banksy
 
R

Roedy Green

Complain to your ISP server (or which ever one in the chain doing it)
about supporting Supercedes: headers. I've noticed that my native ISP
newsserver doesn't honor it, but news.aioe.org (or a server between them
and the original poster's server) does honor it.
I think the solution to this is supercedes or withdraws should only be
permitted on digitally signed messages, and the withdraw must be done
with same signature.
 
R

Roedy Green

Complain to your ISP server (or which ever one in the chain doing it)
about supporting Supercedes: headers. I've noticed that my native ISP
newsserver doesn't honor it, but news.aioe.org (or a server between them
and the original poster's server) does honor it.

Done.

They Telus.ca give you a postage stamp window for you complaint, but
cut/paste defeated them.

I am happy hack the vandal used is so mindless. It will not require
any major overhaul of NNTP to defeat. If Telus does as I request, does
it require all upstream news severs to comply as well? Perhaps it
depends on how fast the vandal gets his supersede out.

Here is what I said.

The security of the Telus Newsgroup server has been compromised by
vandals. What they are doing is REPLACING message with tampered ones
containing gibberish or obscenities. They are doing this using a
little know known feature of NNTP protocol called "SUPERSEDES". It is
similar to cancel, but allows the vandal to insert his own message
with the same ID as the original. Please stop honouring such requests,
unless perhaps the original message was digitally signed and the
request to supercede is signed with the same key. Here is an example
of a tampered message: Path: edtnps82! newsfeed2.telusplanet.net!
newsfeed.telus.net! feeder.erje.net! news.ett.com.ua! news.te.net.ua!
postnews.google.com! news4.google.com! lewscanon.dildos.com!
CorruptMegalomaniacalPriest From: Lew
<[email protected]> Newsgroups:
comp.lang.java.programmer Subject: Re: PNG transparency Supersedes:
<[email protected]> Date: Sun, 03 Aug 2008
15:08:13 GMT Organization: Those who come with a sword, will die from
the Sword Lines: 26 Approved: (e-mail address removed) (Infinite
Intelligence) Message-ID: <[email protected]> References:
<[email protected]>
<[email protected]> <6a29702e-c938-435b-
(e-mail address removed)>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]> Reply-To:
(e-mail address removed) (Big-8 Lunacy) NNTP-Posting-Host:
d106-75.tenet.odessa.ua X-Trace: toster.te.net.ua 1217804146 13359
195.138.75.106 (3 Aug 2008 22:55:46 GMT) X-Complaints-To:
(e-mail address removed) NNTP-Posting-Date: Sun, 3 Aug 2008 22:55:46 +0000
(UTC) X-Newsreader: Xnews/2006.08.24 X-Intelligence1: You are all a
part of Infinite Intelligence. Xref: newsfeed2.telusplanet.net
comp.lang.java.programmer:830799
 
J

Joshua Cranmer

Roedy said:
I am happy hack the vandal used is so mindless. It will not require
any major overhaul of NNTP to defeat.

Okay, I'm probably being pedantic here, but it's NNTP that's the
problem, it's the Usenet message structure. RFC 1036 is so ancient that
all servers base their stuff based on the expired "Son of 1036" draft; I
am basing information here off of the still-in-progress usefor draft
just updated yesterday.

What it says re cancel control messages (and Supersedes headers) is this:
"Agents acting on control messages SHOULD take steps to authenticate
control messages before acting on them, as determined by local
authorization policy." and "...but an agent MAY always decline to act on
any given control message."

Or, in other words, servers may ignore the request, or use other
information to authenticate messages (e.g., that the path of the old and
new messages are identical), or just execute the request, although it
advises against the latter action in recognition of their abuse.
> If Telus does as I request, does
it require all upstream news severs to comply as well?

The upstream news servers don't have to comply as well, so long as all
servers blithely accepting the requests push the old message out before
the request comes. Given that the vandal gets his messages out in a
giant batch while the targets spread theirs out all day long, the
timeframe is probably limited to a few minutes there, if at all. I'd
need to know more about network topology to give definite answers.
 
K

Knute Johnson

Roedy said:
I had an idea about preparing browser shots. You might want to
include a jpg thumbnail on a browsershot page showing what the page is
SUPPOSED to look like.

Either that or you need some text to describe the proper rendering.

I could do that but it (the page) was only meant to be up for the period
of this discussion. Since you have already posted considerably on the
subject, I think your site is better than mine for continued display.
However if you think I should put up something permanent, I'll work up
something more interesting than what I have there now.
 
R

Roedy Green

Now that's what I call a nice collection of test images!

he does provide GIFs to suggest what they should look like. However he
needs a clear table grid to put everything in to make clear which PNG
corresponds to which GIF and which is a GIF and which a PNG.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top