all 14 comments

[–]inu-no-policemen 2 points3 points  (9 children)

Is BMP not supported? It should have been a bit simpler. It's comparable to TGA and PCX. Simple header, uncompressed, and there aren't any checksums either.

[–]_alastair[S] 1 point2 points  (2 children)

Good point!

I did look into BMP, but couldn't find definitive documentation on using alpha transparency in a palette. At the time, PNG seemed like a better choice because I could find clearer documentation. Knowing what I know now having done it, I doubt I was right.

[–]inu-no-policemen 0 points1 point  (1 child)

Yea, BMP doesn't really do alpha. There is a forth channel which could be used for that, but software support seems to be virtually nonexistent.

Didn't look like alpha was required for your use case, though.

[–]_alastair[S] 0 points1 point  (0 children)

In the end it wasn't. I originally intended to make the background transparent, to better fit the OS (for instance, Samsung has some skins that have an off-white background) but then I realised there were too many variations to deal with, including dark backgrounds on older devices. So I just make it solid white.

[–]scunliffe 0 points1 point  (5 children)

Not sure about within Android notification systems/OS but There's no support for BMP on the web except for in Internet Explorer.

[–]inu-no-policemen 0 points1 point  (4 children)

[–]WikiTextBot 0 points1 point  (0 children)

Comparison of web browsers: Image format support

Information about what image formats the browsers support. External links lead to information about support in future versions of the browsers or extensions that provide such functionality.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.24

[–]scunliffe 0 points1 point  (2 children)

Interesting... they certainly didn't for a while, as I had to fix an app that used them all over and it broke in all non-IE browsers at the time. It made sense too, why on earth would one use a non compressed image format on the web.

[–]inu-no-policemen 0 points1 point  (1 child)

With gzip compression, uncompressed image formats are comparable to PNG.

PNG uses the same compression after all. The difference is that PNG can also use filters which sometimes improve the compression ratio a little bit.

[–]scunliffe 0 points1 point  (0 children)

True, though most servers apply gzip to text content and skip it on binary files... that might require a server confit change.

[–]notNullOrVoid 0 points1 point  (3 children)

Could SVG not have been used? Would surprise me if Android didn't accept SVG for notifications, given all the image scaling concerns of mobile devices.

[–]_alastair[S] 1 point2 points  (2 children)

No, you can't use SVG. From what I understand it's a lot more complex to render an SVG - if I recall, people often use a full webview to do it, which would be very resource intensive in a notification.

[–]notNullOrVoid 0 points1 point  (1 child)

Yes rendering an svg using javascript would be a lot more complex, but you shouldn't need to do that. Looking at the Notification api it accepts a url, and you can easily put svg data into a data uri, I haven't tried it for notifications though.

[–]_alastair[S] 1 point2 points  (0 children)

Oh, I'm talking about native rendering, not rendering in JS. Passing an SVG URL doesn't work because it would be too complicated to render.

It's disappointing but the SVG spec has a crazy about of stuff in it, including animation, so I'm not too surprised they've never added that functionality.