Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Why there is no lossy image format with alpha?

ciantic (626550) writes | more than 3 years ago

8

ciantic (626550) writes "Almost every web developer would benefit from image format that has the capabilities of JPEG and Alpha Channel like in PNG. But why there is not any? Google is developing WebP but it seems like it does not include this killer feature, and as it is discussed it gets to stand still when engineer asks something specific. What is the main issue here? Clearly web is missing this kind of format. From my naive stand point of view the alpha channel would be just like RGB channels, with slight exception the extreme values of Alpha should not be compressed. If you need examples why such format is needed, there is not shortage of that in web. Common example for this kind of need is tilted Polaroid picture with transparent background, and gradient fading in photographs."
Link to Original Source

cancel ×

8 comments

Sorry! There are no comments related to the filter you selected.

We already have an answer (1)

segin (883667) | more than 3 years ago | (#34938168)

Such a format already exists, it's called PNG. Advances on bandwidth, storage, etc. plus the public insistance on pixel-perfect means that lossy picture compression is no longer needed or wanted.

Re:We already have an answer (1)

ciantic (626550) | more than 3 years ago | (#34938228)

Firstly, Google does not think that Lossy compression is not needed, they are developing one themselves.

You can't seriously think that PNG would be right format e.g. for those two examples I put up there.

There are many other use cases besides those two, where PNG would be a huge in size.

Re:We already have an answer (1)

segin (883667) | more than 3 years ago | (#34941084)

Firstly, Google isn't always right.

Secondly, I believe that the size issue can be addressed by using better lossless algorithms. PNG uses zlib deflate, which is Huffman coding + Lempel-Ziv 77, also the same algorithm used in gzip and PKZIP. The algorithm is dated, and uses rather small block sizes (32,768 bytes, IIRC). Some gains in PNG can be had by running the PNG through AdvanceCOMP [sourceforge.net] , but PNG likely could achieve better compression with better algorithms, such as Lempel-Ziv-Markov chain algorithm (LZMA), without sacrificing too much in terms of decompression speed. Additionally, you could employ additional lossless schemes that are designed specifically to compress the input in question - FLAC has lossless compression methods that are only really applicable to audio input. Instead of creating another format that's going to mutilate our images, why not just improve an existing one to compress better while staying pixel-perfect?

grammar (1)

Fibe-Piper (1879824) | more than 3 years ago | (#34939528)

grammar: "when engineer asks";

Maybe "when an engineer asks" or "when engineers ask"?

Re:grammar (1)

ciantic (626550) | more than 3 years ago | (#34942854)

Yeah, I have problems with indefinite articles, probably because there is no similar things in Finnish.

But I don't mind if it were edited, there probably ain't edit button I could use? I often resort to editing my misspellings in internet.

On the other hand I can see the point of not having it, since it can be used to skew the history, but rightly used edit button can be useful.

nice idea, but.. (1)

Johann Lau (1040920) | more than 3 years ago | (#34941904)

..those two cases don't convince me at all: for rotating images there is CSS3, and for the other example I'd rather overlay a vignette (which should compress super well and could be reused for all images), if that couldn't even be done with an inset box-shadow. Why would you want to bake the design of your site into your images?

Don't get me wrong, I wouldn't mind a lossy image format that has alpha in the least, but not once did I *miss* it so far. Maybe you have some more examples of where this would be useful?

Re:nice idea, but.. (1)

ciantic (626550) | more than 3 years ago | (#34942600)

For example here is a fella in front [niinisto.net] , I have now similar case where I should have a fella in front and background should change (and user should be able to upload own background for the season). Sure I can do some server-side trickery and add the fella to the background user supplied, but all the fuss for that.

In fact, I would probably save every layering image using Alpha channel if it were possible, because it would allow user to change the background of page and other image elements would automatically match. It would be allow many kind of personalizations using simple background changes. Like this [csszengarden.com] , or this [csszengarden.com] , or even this [csszengarden.com] , one more [csszengarden.com] .

Making layouts that can easily be personalized is really hard currently.

JPEG 2000 does this, but nobody seems to care (1)

Khopesh (112447) | more than 3 years ago | (#34943672)

We live in a world in which nobody cares about a few hundred extra kilobytes here or there. Single-image files are therefore already considered "good enough" to push any would-be developers into other formats (specifically video, which is also stealing from audio for the same reason). To this end, PNG is the tool to use for alpha channels if you can't do what you want with CSS transparency [impressivewebs.com] (spec [w3.org] ).

Advancements in compression would need more than just a fancier general-purpose compression scheme, it would need a full rewrite (much in the way vorbis leaped beyond mp3). It might even require a radically different paradigm, such as wavelet compression [wikipedia.org] , which is used by JPEG 2000 [wikipedia.org] for still images and Dirac [wikipedia.org] for video. The fact that neither of those are seeing much use or even attention is a tribute to the fact that people don't care enough. They offer vastly superior compression, yet are stuck in academia for unknown reasons (well, Dirac is used internally by the BBC and is competitive with H.264/VP-8 without any known patent issues, so it's not out of the picture quite yet, but it's having trouble getting visibility...).

In fact, according to that Wikipedia page, JPEG 2000, a lossy image storage format, supports transparency and alpha planes by means of its "side channel spatial information."

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>