flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > [help] Saving a bitmap in memory to a png on disk?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 12:30
I need an example of how to save a bitmap in memory to a png on disk and maybe also load a png from disk if you have one.

The algorithm example must be delivered before 2 PM the following day. Thank you.

Together we will make the world a better place. You can post an example of how to do this in GDIplus, there is a way to do it there. But if you have your own method, please provide it.

Thank you VERY MUCH.
Post 28 Sep 2024, 12:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 28 Sep 2024, 12:39
Why the deadline?

Homework help?

BTW: 2PM is meaningless. Which timezone? Which day?
Post 28 Sep 2024, 12:39
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 12:42
Please don't fill up my thread with garbage, fillers will confuse those who are looking for the same algorithm. If you don't want to help then stay away, and stay 1,000 miles away.
Post 28 Sep 2024, 12:42
View user's profile Send private message Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 12:44
NOW, people, let's get down to business. Any examples? Saving from a bitmap in memory to a png on disk. and then maybe the reverse, from png on disk to bitmap in memory.

Faster the better, even faster is even better, THE fastest is THE best. It's up to you how good quality it has. Bring it to the forum and show it off.

I can't believe how little material there actually is in the assembly world when it comes to PNG files.

Personally, It's just wrong that every asm programmer should make his own PNG library, it's wrong.

This is the very reason I'm requesting your hand, and it's a great hand, show it's capabilities off and let it loose.
Post 28 Sep 2024, 12:44
View user's profile Send private message Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 727
Ali.Z 28 Sep 2024, 13:27
yes i do have an example, but i will sell it for 1000euro.

_________________
Asm For Wise Humans
Post 28 Sep 2024, 13:27
View user's profile Send private message Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 15:12
People, let us bring the forum back to it's 90's glow where it shined freedom, and not money.


Last edited by nasm on 20 Oct 2024, 20:32; edited 1 time in total
Post 28 Sep 2024, 15:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 28 Sep 2024, 15:36
nasm wrote:
People, let us bring the forum back to it's 90's glow where it shined freedom, and not money.
The 90's was also about people being open and honest about their intentions. You could start the ball rolling by answering the basic questions I posted before.
revolution wrote:
Why the deadline?

Homework help?

BTW: 2PM is meaningless. Which timezone? Which day?
Post 28 Sep 2024, 15:36
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 16:02
People, my definitive friends: If you post an example, keep in mind that I appreciate short ones.

Thank you.

_________________
Do you think anyone will sell their soul over a 10 cent yoghurt with a bad after taste that lasts, a decade?
Post 28 Sep 2024, 16:02
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4061
Location: vpcmpistri
bitRAKE 28 Sep 2024, 18:07
I've a brief example of building stb_image and used it to display a PNG.

You can build stb_image_write similarly and write PNG files.

(Note: Tests have shown that the Windows decoder is faster than other libraries - that is not the purpose here.)

I've also made a PNG writer with fasmg. Very Happy

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 28 Sep 2024, 18:07
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 18:50
It's not strange that Windows decoder is faster MS have started to use Rust programming language, it just piles out the best code ever.

Rust is to HLL languages what fasm is to assemblers. It produces tight, small optimized code, in minimized form.

Ok thanks buddy, I will check it out.
Post 28 Sep 2024, 18:50
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2545
Furs 28 Sep 2024, 20:12
nasm wrote:
It's not strange that Windows decoder is faster MS have started to use Rust programming language, it just piles out the best code ever.

Rust is to HLL languages what fasm is to assemblers. It produces tight, small optimized code, in minimized form.

Ok thanks buddy, I will check it out.
Can I have what you're smoking?
Post 28 Sep 2024, 20:12
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4061
Location: vpcmpistri
bitRAKE 28 Sep 2024, 20:52
nasm wrote:
It's not strange that Windows decoder is faster MS have started to use Rust programming language
The truth is actually more substantial:
https://github.com/putara/pngbench

... perhaps more recent data would tell a different story.

Personally, I engineered a modification of QOI specifically tuned for an assembly implementation. It's close enough to PNG and super-fast/tiny.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 28 Sep 2024, 20:52
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 21:05
For the sake of having it in the library, does anyone have a GDIplus version of the routine?

I think people will love you if you post it here.

Yep, fast PNG is very important, rendering videos is heavy duty work.

Maybe it is QOI I should use, it's perfect for video rendering in assembly.
Post 28 Sep 2024, 21:05
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4061
Location: vpcmpistri
bitRAKE 28 Sep 2024, 21:15
If you search for madmatt's examples - he did a wonderful array of GDIPlus examples. I haven't felt a need to duplicate that effort - if you've used one COM interface - you've used them all, lol.
Post 28 Sep 2024, 21:15
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 28 Sep 2024, 22:08
I have used GDIplus about 15 years ago
Post 28 Sep 2024, 22:08
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4061
Location: vpcmpistri
bitRAKE 29 Sep 2024, 02:12
Overclick, bypasses GDIplus and uses WIC to load a PNG. GDIplus image support comes from WIC.
Post 29 Sep 2024, 02:12
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 29 Sep 2024, 14:24
So it's a wrapper, I wonder which layer will be rendered obsolete first. But it's a useful have.

Ali, even if your routine is worth nothing, you can still post it for evaluation, this is a PNG thread and we must have them all. Don't be shy or afraid to post it.

I would like to see as many people as possible post their private PNG code in here for everyone to use.

Hurry up because we are living on borrowed time, AI is taking over soon.

_________________
Do you think anyone will sell their soul over a 10 cent yoghurt with a bad after taste that lasts, a decade?
Post 29 Sep 2024, 14:24
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4061
Location: vpcmpistri
bitRAKE 29 Sep 2024, 15:40
nasm wrote:
So it's a wrapper, I wonder which layer will be rendered obsolete first.
Many codec plug into WIC, and GDIPlus is used in many other MS apps (like PowerToys). They'll probably evolve with Windows and become obsolete with Windows, imho.

It's 32-bit MASM syntax, but to not mention MadWizard's PNGlib would be a crime.
MadWizard wrote:
This library allows you to decode and display PNG images in your applications. The library is very small and has been written in assembly (MASM32). The library supports both interlaced and non-interlaced PNGs, in all color types mentioned in the PNG specifications version 1.0. The library is easy to use, has detailed documentation. Includes and headers are supplied for use with MASM32 and Visual C.

Several code samples (MASM32 and Visual C) are included as well, one of them is the PNGview program: a 30kb PNG viewer, written in C using the PNGlib.

PNG files are designed to be patent-free, so no licenses or fees of any kind are required to use this library. The library itself is free as well, however for commercial use, please contact me first to ask permission (see the license in the documentation for more information). Usually this is no problem.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 29 Sep 2024, 15:40
View user's profile Send private message Visit poster's website Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 29 Sep 2024, 16:20
MadWizard, I will check it out. You know the mad wizard, he is the real deal. It's probably smooth as butter. I wonder if he has more nicks. Some people build entire libraries with 50 nicknames.
Post 29 Sep 2024, 16:20
View user's profile Send private message Reply with quote
nasm



Joined: 02 Nov 2021
Posts: 183
nasm 29 Sep 2024, 18:11
Is anyone willing to convert MadWizard's PNGlib to fasm?

Someone could convert it while others could post their own PNG code. This is a PNG thread, everything is useful.

_________________
Do you think anyone will sell their soul over a 10 cent yoghurt with a bad after taste that lasts, a decade?
Post 29 Sep 2024, 18:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.