file format with transparence

file format with transparence

Post by Hank Bai » Sun, 09 Sep 2001 08:17:03



Is there an image file format that stores transparency percentage
information about each pixel. something beyond the on/off transparency of a
GIF file.

thanks in advance
hank

 
 
 

file format with transparence

Post by Marco Schmid » Sun, 09 Sep 2001 08:27:10


On Fri, 07 Sep 2001 23:17:03 GMT, "Hank Bain"


>Is there an image file format that stores transparency percentage
>information about each pixel. something beyond the on/off transparency of a
>GIF file.

That's what alpha channels are for. File formats that support alpha
channels include TIFF, PNG and TGA.

Regards,
Marco

 
 
 

file format with transparence

Post by Jonas Meyer Rasmusse » Sun, 09 Sep 2001 08:29:03


The TGA format has what you are looking for.

this site has a description as far as i can remember
www.wotsit.org

Jonas

 
 
 

file format with transparence

Post by Ric » Sun, 09 Sep 2001 09:30:42


[Please do not mail me a copy of your followup]



Quote:>Is there an image file format that stores transparency percentage
>information about each pixel.

Use png.  <http://www.libpng.org/>

PNG has better compression than GIF, is unencumbered by patents,
supports gamma, supports 16-bits per channel and fully supports the
alpha channel.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book http://www.xmission.com/~legalize/book/
    Don't Support Spammers!  Boycott Fractal Painter 7!
     <http://www.xmission.com/~legalize/spammers.html>

 
 
 

file format with transparence

Post by Alan » Sun, 09 Sep 2001 09:38:09




Quote:

>Is there an image file format that stores transparency percentage
>information about each pixel. something beyond the on/off transparency of a
>GIF file.

Hank:

There are a number of lossless, alpha-aware formats you could use, in order of
preference:

PNG: Format is open, compression is top-notch for true color images, highly
recommended. WinImages, Photoshop, Paintshop, and many others all load and save
interchangeable PNGs (well, in Paintshop, you have to use "Export PNG" instead
of save PNG to get a usable alpha channel, but it DOEs work.) Anything that
doesn't handle PNG is seriously behind the times. :-) Only disadvantage is that
PNG isn't a layered file format.

PSD: Format is semi-open, supports layers, alpha and etc., it's native to
Photoshop, and is supported by Photoshop, Paintshop and WinImages and many,
many others. Unfortunately, because the format is partially closed, it is more
than possible to save an image that nothing else will understand no matter
*how* you save it or re-save it - if that wasn't true, it'd be the #1
recommendation on this list. Oh, and the compression... yeah, it sucks. :-)

ELF: Format is open, supports layers, alpha and etc, compression is awesome,
and at least WinImages supports it - but others could support it because it's
open. You can save images that are closed, but you can also re-load them and
save them open without losing any image information. ELF is very cool because
it has a lot more capability and flexibility than any of the other formats,
it's a hugely powerful image handler, and what I use all the time.

PSP: Format is open, native to Paintshop pro, supports layers, alpha and etc,
compression is middling, and at least Paintshop supports it - but others could
support it because it's open.

Targa: Format is open, and so reasonable to use, but compression is awful.

TIFF: (VERY bad idea - compression ownership is claimed by Unisys, and while
the ownership claim itself is highly dubious [no, let me re-phrase... it's not
dubious, it's LUDICROUS], no one can afford to fight an 800-lb gorilla that
thinks it's right - and on top of that, the format's true-color compression is
utterly lousy, too)

-Sk

 
 
 

file format with transparence

Post by Marco Schmid » Sun, 09 Sep 2001 10:11:36


[...]

Quote:>TIFF: (VERY bad idea - compression ownership is claimed by Unisys, and while
>the ownership claim itself is highly dubious [no, let me re-phrase... it's not
>dubious, it's LUDICROUS], no one can afford to fight an 800-lb gorilla that
>thinks it's right - and on top of that, the format's true-color compression is
>utterly lousy, too)

That's nonsense. First of all, TIFF supports more than just LZW as
lossless compression type (which I assume you're talking about). Also,
if you are using software that has TIFF / LZW support, the software
creator (e. g. Adobe or Jasc) pays for the LZW license, not you as a
customer. BTW, I also find the LZW patent laughable, but that's
another issue.

I agree with you that the original poster must regard (1) compression
rate, (2) encoding and decoding speed, (3) availability of software
reading and writing a particular format, (4) support for multiple
layers.

While editing an image, I would advise to use the applications native
file format (if available). So .psp for Paintshop Pro, .psd for
Photoshop, .xcf for The Gimp. Compression shouldn't be necessary
because it doesn't matter if the image takes 80 MB on disk while it's
edited (not with 100+ GB HDDs). It would only take away time if you
save your image very often.

Once the image is ready, good compression may become an issue (if you
want to store that image on CD-R or send it to someone). However, even
good lossless image compression does not reduce a typical photo's size
by much more than 50 %. The difference between LZW, Deflate (which is
used by PNG) and anything else (like ELF, I don't know that) shouldn't
be too large. That's why a well-known file format should be preferred.

It's just not recommendable to use some dubious (in the sense of
popularity) file format just to get a compression ratio that is a few
percent better. So even TGA is an option, especially when new code is
to be written. Creating uncompressed TGAs can be done with very little
code. If you want decent compression, just put your TGA file into a
ZIP archive. It may not be exactly as good as PNG but should come
close (both use Deflate).

If the edited image still has several layers which must not be merged
there will be no alternative to the original file format (.psp, .psd,
.xcf).

Regards,
Marco

 
 
 

file format with transparence

Post by Mark Mulli » Sun, 09 Sep 2001 10:25:38


You can also create 32 bit BMP files on windows.  Most apps ignore the alpha
channel, and msft refers to the byte as reserved, but it's there.  Other
formats mentioned are better, but you can even use dibs.

Quote:

> Is there an image file format that stores transparency percentage
> information about each pixel. something beyond the on/off transparency of
a
> GIF file.

> thanks in advance
> hank

 
 
 

file format with transparence

Post by Alan » Sun, 09 Sep 2001 14:41:40




Quote:>>TIFF: (VERY bad idea - compression ownership is claimed by Unisys, and while
>>the ownership claim itself is highly dubious [no, let me re-phrase... it's not
>>dubious, it's LUDICROUS], no one can afford to fight an 800-lb gorilla that
>>thinks it's right - and on top of that, the format's true-color compression is
>>utterly lousy, too)

>That's nonsense. First of all, TIFF supports more than just LZW as
>lossless compression type (which I assume you're talking about).

Yes. Sort of by default; actually, I can't think of a real lossy format that
supports alpha channel data... unless you count GIF (color reduction=lossy,
transparent color= alpha), and that would be pretty dubious... :-)

Quote:> Also,
>if you are using software that has TIFF / LZW support, the software
>creator (e. g. Adobe or Jasc) pays for the LZW license, not you as a
>customer. BTW, I also find the LZW patent laughable, but that's
>another issue.

You may think it's nonsense. However, while you are entitled to your own
opinion, you are not entitled to your own facts. It's not "nonsense" at all. It
makes little sense to support a file format that is encumbered by trickery and
financial rippery - and TIFF, courtesy (and I use the term VERY loosely) of
Unisys, is a very heavily encumbered format in just those ways. Supporting GIF
and TIFF is what is a bad idea; it encourages companies with no corporate ethic
worth mentioning - companies like Unisys - to pull bait and switch on the
entire technical community, just like Unisys did. Those file formats are
"tainted" until and unless the entire LZW scam is recanted by the predators at
Unisys or goes out of scope due to date or changes in the law. To use
uncompressed TIFF (no LZW, tra la la) and to imagine that you're helping things
is delusional; most users just see "a TIFF file" and don't know one way or
another what kind of compression is being used. The fewer GIF and TIFF files
ANYONE uses for ANY reason, the better off everyone (except Unisys) will be.
And Unisys can take a long walk off a short pier.

Q: Someone's been run over. How do you know it was a Unisys employee?

A: No skid marks.

Quote:>While editing an image, I would advise to use the applications native
>file format (if available). So .psp for Paintshop Pro, .psd for
>Photoshop, .xcf for The Gimp.

Well, that's fine as far as it goes, but in some cases, you can't do something
in program A that you can in program B - so interoperability is quite useful
and you may, in spite of yourself, find yourself using something other than the
program where the format originated. I'd rather use paintshop to paint and
WinImages for effects and editing than spend time in Photoshop... it's just too
limited (I do own all three programs.) But PSD files are quite common, so all
that interoperability is great. If you send me a PSD, the odds are it'll never
see Photoshop again. :-)

Quote:> Compression shouldn't be necessary
>because it doesn't matter if the image takes 80 MB on disk while it's
>edited (not with 100+ GB HDDs). It would only take away time if you
>save your image very often.

That's *amazingly* presumptuous. Not everyone has 100 Gb hard disks, and not
all images are stored on hard disks, and some people manage many images so that
compression is, in fact, an issue even with large storage devices, and
furthermore, archival storage is still most common on CD's of various flavors,
and they're only 640 meg, and THEN we get to those folks who pop images on
floppies from time to time for reasons known only to them, and THEN we get into
the issue where people store images on websites where they are PAYING for space
and so want to get the most out of their money, which is a very sensible and
reasonable approach... in other words, to use your own phrase, "that's
nonsense." :-)

Quote:>Once the image is ready, good compression may become an issue (if you
>want to store that image on CD-R or send it to someone). However, even
>good lossless image compression does not reduce a typical photo's size
>by much more than 50 %. The difference between LZW, Deflate (which is
>used by PNG) and anything else (like ELF, I don't know that) shouldn't
>be too large. That's why a well-known file format should be preferred.

Not so. PNG isn't just deflate - it uses filters (as does ELF) to predict
future values. Therefore, these formats only encode the *error* between the
actual value and the pixel. They use different methods, and sometimes PNG does
best, sometimes ELF does best, but they pretty well both beat the pants off of
raw LZW or deflate. For large images, a 10% different could be many megabytes.
Which might be room for hundreds, even thousands, of JPEGs on a website, for
instance.

Quote:>It's just not recommendable to use some dubious (in the sense of
>popularity) file format just to get a compression ratio that is a few
>percent better.

I'd agree; but then again, I didn't make any such recommendation.

I use ELF, for instance, because it can store things that the other formats
can't, things that are of enormous use to me. The fact that it has compression
as good as, or better than in some cases, PNG, is just icing on the cake.

Quote:> So even TGA is an option, especially when new code is to be written.

TGA is a perfectly good format, though "fat". I'd put it pretty far down on the
list of desirables, unless you have specific hardware or software compatibility
requirements (some hardware animation systems work with TGAs, for instance.)

Quote:> Creating uncompressed TGAs can be done with very little
>code. If you want decent compression, just put your TGA file into a
>ZIP archive. It may not be exactly as good as PNG but should come
>close (both use Deflate).

PNG's filtered storage mode (which any decent program uses, of course - and
that includes Photoshop, Paintshop and WinImages) will beat the living poop out
of raw deflate storage in terms of compression the vast majority of the time.
Period. End of story.

Quote:>If the edited image still has several layers which must not be merged
>there will be no alternative to the original file format (.psp, .psd,
>.xcf).

Again, that's why I use ELF. PSD, PSP and XCF don't have the capacity to deal
with the image data I typically use. Nor do the programs that originated those
formats.

:-)

-Sk

 
 
 

file format with transparence

Post by Glenn Randers-Pehrs » Sun, 09 Sep 2001 20:27:21



> actually, I can't think of a real lossy format that
> supports alpha channel data... unless you count GIF (color reduction=lossy,
> transparent color= alpha), and that would be pretty dubious... :-)

JNG (JPEG Network Graphics) from the PNG Development Group is JPEG plus
a PNG-encoded or JPEG-encoded alpha channel.  It will be supported in
Mozilla/Netscape as a part of its MNG (Multiple-Image Network Graphics)
support.

See http://www.libpng.org/pub/mng/ for documentation and
http://pmt.sourceforge.net/jdaa for some examples.

Glenn

 
 
 

file format with transparence

Post by Alan » Mon, 10 Sep 2001 03:42:40




Quote:>JNG (JPEG Network Graphics) from the PNG Development Group is JPEG plus
>a PNG-encoded or JPEG-encoded alpha channel.

Hi Glenn,

Thanks for the post - Wow! *WAY* Cool, I didn't know about the transparency - I
naively thought JNG was just an animated stream of JPEG data. I'll have to
pester the image software people about that, though at least JASC and BBS
probably already know...

Quote:>  It will be supported in Mozilla/Netscape as a part of its MNG (Multiple-Image Network Graphics)
>support.

Sure would be nice to see it in Explorer... maybe Netscape still has enough
clout to make MS want to get off their butts and relieve us of this GIF problem
once and for all with MNG. Know anything about native Explorer support of MNG?
And/or JNG?

-Sk

 
 
 

file format with transparence

Post by Marco Schmid » Mon, 10 Sep 2001 23:45:17


Alan, first of all, don't get me wrong - the "nonsense" part was only
about your statement that TIFF == TIFF / LZW, not about your entire
posting.

Quote:>Yes. Sort of by default; actually, I can't think of a real lossy format that
>supports alpha channel data... unless you count GIF (color reduction=lossy,
>transparent color= alpha), and that would be pretty dubious... :-)

I don't think there are any popular lossy formats other than JFIF. I
think that TIFF supports JPEG type compression, so you might be able
to add a channel for transparency information which will also be
JPEG-compressed. But no software will probably be able to load that
and the content of the alpha channel might not be suitable for
JPEG-type compression.

Quote:>You may think it's nonsense. However, while you are entitled to your own
>opinion, you are not entitled to your own facts.

[...]

I'm with you on the patent issue. But TIFF is more than TIFF / LZW.
TIFF is very complex, some may say it's a mess. But to rant against it
because one of its many compression types is patented in some
countries really isn't convincing - *in my humble opinion*!

[interoperability with PSD]

I don't think it's typical to change the image editing program while
the editing is in progress. Or to give a partially edited image to
someone else. Besides, while the more common features will certainly
be supported by all PSD-reading software, supporting a complex file
format perfectly is almost impossible.

Quote:>That's *amazingly* presumptuous. Not everyone has 100 Gb hard disks, and not
>all images are stored on hard disks, and some people manage many images so that
>compression is, in fact, an issue even with large storage devices, and
>furthermore, archival storage is still most common on CD's of various flavors,
>and they're only 640 meg, and THEN we get to those folks who pop images on
>floppies from time to time for reasons known only to them, and THEN we get into
>the issue where people store images on websites where they are PAYING for space
>and so want to get the most out of their money, which is a very sensible and
>reasonable approach... in other words, to use your own phrase, "that's
>nonsense." :-)

I think we are having different things in mind here. People who are
doing image retouching and editing won't suffer from a  lack of hard
disk space, especially while editing a single image. I don't think
anyone is editing 1000s of images at the same time.

Archiving the images or putting them on a website is a whole different
thing than having to edit an image.

Quote:>Not so. PNG isn't just deflate - it uses filters (as does ELF) to predict
>future values. Therefore, these formats only encode the *error* between the
>actual value and the pixel. They use different methods, and sometimes PNG does
>best, sometimes ELF does best, but they pretty well both beat the pants off of
>raw LZW or deflate. For large images, a 10% different could be many megabytes.
>Which might be room for hundreds, even thousands, of JPEGs on a website, for
>instance.

Yes, PNG is more than just Deflate. But as you say, the difference is
hardly more than 10 percent. That's not much. As you will most
probably not keep your originals (the PNGs) and the webserver on the
same machine, I don't think you will have an advantage from the
savings. Besides, if you are keeping a huge collection of high-quality
images, you can most likely spend some money on one of the already
mentioned 100 GB HDDs...

Quote:>I'd agree; but then again, I didn't make any such recommendation.

>I use ELF, for instance, because it can store things that the other formats
>can't, things that are of enormous use to me. The fact that it has compression
>as good as, or better than in some cases, PNG, is just icing on the cake.

I just wanted to add that there are other properties of an image file
format to be considered, popularity (in the sense of load / save
support) being one of them. I don't know about ELF's features, I just
know that it hardly is a well-known format.

Quote:>TGA is a perfectly good format, though "fat". I'd put it pretty far down on the
>list of desirables, unless you have specific hardware or software compatibility
>requirements (some hardware animation systems work with TGAs, for instance.)

Yes, TGA is only recommendable because of its simplicity.

Quote:>PNG's filtered storage mode (which any decent program uses, of course - and
>that includes Photoshop, Paintshop and WinImages) will beat the living poop out
>of raw deflate storage in terms of compression the vast majority of the time.
>Period. End of story.

I think we already had that. Winning the compression ratio race by a
few percent isn't a decisive factor for some people. Not for me,
certainly.

Quote:>Again, that's why I use ELF. PSD, PSP and XCF don't have the capacity to deal
>with the image data I typically use. Nor do the programs that originated those
>formats.

OK, can't argue with that ;-)

Regards,
Marco