|
Yeah, I've considered that. It's hard to find code to load it progressively like JPG does though. I'll have to keep looking, or wind up dramatically modifying something out there. Maybe I'll try to add that now. It gives me something to do.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Nobody who uses images on websites cares about that - it's "just a image stream" and if one format has an advantage for them, they'll use it. And a transparency layer is an advantage to many site builders.
They don't care about poor old us, after all!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yeah, I think finally implementing PNG might be the way to go here.
To err is human. Fortune favors the monsters.
|
|
|
|
|
|
Because it's of limited use for IoT stuff, and I'd rather not waste the flash space on it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
What space? All you would need to do is parse it into a BITMAPINFOHEADER structure and write the DIB directly to your screen. The only space required might be your BITMAPINFOHEADER header definition.
|
|
|
|
|
And without a proper use case there's no reason for it, even if it's only a BITMAPINFOHEADER that has no business being in there without a use case.
JPGs have dozens of use cases - heck I use them in my commercial projects w/ this lib.
Arguably, so do PNGs for similar reasons.
But a web "ICO" which is not a real windows ICO, no. Literally the only thing they're good for is displaying a little picture in a web browser for a particular url. There's no use case there for IOT, not really.
That's why I won't include it.
Now, there are some fairly good use cases for implementing BMP support which is similar, but the actual spec for that is nasty, and way too complicated to do me any good for what I'm targeting. MS should have kept it simple.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Hmmm,
It's been a long time (months) since I last looked at what you are doing. I think last I looked you were ripping out parts of the TrueType parsing code from STB[^] or something.
I think it has JPEG and PNG decoders too, have you looked?
|
|
|
|
|
Yeah, but they're not geared for IoT. I had to gut the truetype stuff to make it all work from a stream instead of RAM. I wound up changing most of that file.
I don't want to go through the same thing with the PNG loading. I'd like to look for a different source - preferably something that loads it progressively.
The STB stuff is PC gaming code so it's geared for having gobs of RAM.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: I'd like to look for a different source - preferably something that loads it progressively.
I just glanced over the PNG spec and progressive decoding only works on PNG images that were 'progressive encoded'. I think that means multiple IDAT sections. With a normal (non-progressive) PNG having a single IDAT.
So you would only benefit here if you control the image encoding too. Progressive encoded PNG images are rare today from my understanding.
|
|
|
|
|
I think I can still do it line by line
To err is human. Fortune favors the monsters.
|
|
|
|
|
Sweet,
Can you point out which step in decoding PNG images uses lines? I'd like to see how it's done.
Here's an overview[^], show me which decoding step uses lines.
|
|
|
|
|
I couldn't say off hand. I was looking at some code on github some months back on doing this.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Any reason you can't convert a suitable image to jpg and add it to your GitHub project? It would then be easily accessible and your preferred format.
Keep Calm and Carry On
|
|
|
|
|
That would defeat the purpose of the demo, which is to load a picture off a network stream.
Edit: Never mind. I see what you mean. I'm a bit slow today. Yeah, I could do that.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: Should I implement png?
Yes.
And WebP[^].
And AVIF[^].
And don't forget APNG[^] too.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm not making a web browser. I need bare minimum functionality. This isn't a Cortex-A I'm targeting.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Quote: I'm not making a web browser.
Not at the moment... But all the stuff I'm reading from you, there is a chance that you develop a web browser for ATTINY85 or similars
|
|
|
|
|
Okay, I deserved that.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Why limit yourself to a logo? Using a company logo has drawbacks anyway, such as legal copyright etc., or implications of involvement with the company (as you suggest by not wishing to use Microsoft or Facebook examples).
Why not choose a public domain image of a recognisable landmark or figure, or even take your own photo of such a thing and host it on the web (thus avoiding any IP issues)?
(Finding small JPGs is likely to be a hard task anyway since for small images, there is often little benefit in using JPG compression - it just results in ugly artefacts if compression is high and no advantage if compression is low. It's larger images where JPG comes into its own, really...)
|
|
|
|
|
viewing an image over the web does not violate copyright laws, even if the viewer is an IoT device.
To err is human. Fortune favors the monsters.
|
|
|
|
|
True, but if you (say) use the Coca-Cola logo and advise people to view said logo on your device (even as a proof-of-concept) there's the risk that Coca-Cola will complain (fair use, passing-off, trademark etc) or demand you include a copyright / trademark notice. If you're aiming to have an instantly-recognisable logo, companies of that size/fame can be a bit tetchy about how their logo is used. Very unlikely, true, but possible. But for those same reasons of control and wanting a "perfect" viewing experience, they're unlikely to have a .JPG logo anyway.
|
|
|
|
|
Pretty sure Coca-Cola isn't going to come after me for a sample project. I'll risk it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
JPG legally requires a licensing fee. As a result PNG was developed to avoid this fee.
|
|
|
|
|
I think that was .GIF, which was developed by Compuserve who got a bit tetchy about it. Not aware of a license fee for JPG images...
|
|
|
|