The MASM Forum

General => The Campus => Topic started by: stonelightning on December 07, 2023, 10:47:30 AM

Title: masm pictures not getting recognized radasm
Post by: stonelightning on December 07, 2023, 10:47:30 AM
Good Night!

I came across the issue that i only can import .bmp files when i convert .png to .bmp over paint,
which heavily decreases quality.
When i use some online converter the picture box in radasm wont recognize the bmp file.
I assume its the size?

I will try more tomorrow, maybe you guys have an idea!
Title: Re: masm pictures not getting recognized radasm
Post by: jj2007 on December 07, 2023, 11:44:17 AM
Quote from: stonelightning on December 07, 2023, 10:47:30 AMconvert .png to .bmp over paint, which heavily decreases quality

That should be a lossless conversion. Can you demonstrate this loss of quality?
Title: Re: masm pictures not getting recognized radasm
Post by: stoo23 on December 07, 2023, 12:22:18 PM
Instead of using 'on-line' conversion, you could try using, perhaps surprisingly, WinZip (if you have it)
https://www.winzip.com/en/learn/file-conversions/png-to-bmp/#:~:text=However%2C%20if%20you%20have%20a,all%20of%20your%20file%20types. (https://www.winzip.com/en/learn/file-conversions/png-to-bmp/#:~:text=However%2C%20if%20you%20have%20a,all%20of%20your%20file%20types.)
or
Easy2Convert (Freeware)
https://www.easy2convert.com/png2bmp/#:~:text=Easy2Convert%20PNG%20to%20BMP%20will,often%20work%20with%20PNG%20images. (https://www.easy2convert.com/png2bmp/#:~:text=Easy2Convert%20PNG%20to%20BMP%20will,often%20work%20with%20PNG%20images.)

to see if you still experience Quality issues.
Title: Re: masm pictures not getting recognized radasm
Post by: jj2007 on December 07, 2023, 12:50:31 PM
I've hacked together an image converter for you:

GuiParas equ "Image converter", w700, h700, b LiteBlueGreen, m0
include \masm32\MasmBasic\Res\MbGui.asm
GuiControl MyCanvas, "canvas"
Event CanvasPaint
  GuiImage CL$(), fit
GuiEnd

Just drag an image over the executable, then right click and save e.g. as test.bmp :cool:
Title: Re: masm pictures not getting recognized radasm
Post by: stoo23 on December 07, 2023, 01:09:06 PM
OH !!  :biggrin:  :cool:  well there you go, just like that  :joking:
I might be wrong but I was thinking it may have been Transparent or Alpha channel related issues upsetting the conversion to bmp
I know Gimp has issues doing that conversion.
Title: Re: masm pictures not getting recognized radasm
Post by: TimoVJL on December 07, 2023, 08:46:28 PM
Can we see that png, that don't convert well to bitmap.
You can use Irfanview for tests.

Also a small program to test GdiPlus for it :
Usage:
GdiPlusPng2Bmp.exe SMenu1.png SMenu1.bmp
Title: Re: masm pictures not getting recognized radasm
Post by: stonelightning on December 08, 2023, 08:32:04 AM
It's with every image  :dazzled:
(https://i.postimg.cc/5Y2krnMV/masm.png) (https://postimg.cc/5Y2krnMV)


(https://i.postimg.cc/9Rk1n2pd/masm2.png) (https://postimg.cc/9Rk1n2pd)

(https://i.postimg.cc/wRsFKrfS/masm.png) (https://postimg.cc/wRsFKrfS)
Quote from: jj2007 on December 07, 2023, 12:50:31 PMI've hacked together an image converter for you:

GuiParas equ "Image converter", w700, h700, b LiteBlueGreen, m0
include \masm32\MasmBasic\Res\MbGui.asm
GuiControl MyCanvas, "canvas"
Event CanvasPaint
  GuiImage CL$(), fit
GuiEnd

Just drag an image over the executable, then right click and save e.g. as test.bmp :cool:
Nice! Thats cool  :cool:

Ty all for the help !
Title: Re: masm pictures not getting recognized radasm
Post by: stoo23 on December 08, 2023, 08:52:50 AM
I might be Wrong, but that looks like a Colour 'Bit Depth' issue.
Title: Re: masm pictures not getting recognized radasm
Post by: TimoVJL on December 08, 2023, 09:13:35 AM
Irfanview made a good bmp 923 KB 256 colours
Title: Re: masm pictures not getting recognized radasm
Post by: stoo23 on December 08, 2023, 09:24:54 AM
Good old Irfanview :) was Always a good program  :thumbsup:

Just for the 'heck of it' I used Paint to create a 256 bit depth conversion and it sure looks to be doing the same 

(https://i.postimg.cc/GBKF0Xkh/masm.png) (https://postimg.cc/GBKF0Xkh)

Why it Won't recognize the file, is another thing altogether that greater minds than I (and those familiar with RadAsm), may be able to help with  :smiley:


Title: Re: masm pictures not getting recognized radasm
Post by: stonelightning on December 08, 2023, 09:41:39 AM
Quote from: stoo23 on December 08, 2023, 09:24:54 AMGood old Irfanview :) was Always a good program  :thumbsup:

Just for the 'heck of it' I used Paint to create a 256 bit depth conversion and it sure looks to be doing the same 

(https://i.postimg.cc/GBKF0Xkh/masm.png) (https://postimg.cc/GBKF0Xkh)

Why it Won't recognize the file, is another thing altogether that greater minds than I (and those familiar with RadAsm), may be able to help with  :smiley:



After i converted from paint i had no problems the picture just looked bad.
i will try irfanview asap :cool:
Title: Re: masm pictures not getting recognized radasm
Post by: jj2007 on December 08, 2023, 09:55:03 AM
Quote from: stonelightning on December 08, 2023, 08:32:04 AMIt's with every image  :dazzled:
(https://i.postimg.cc/5Y2krnMV/masm.png) (https://postimg.cc/5Y2krnMV)

Processed with my ImageConverter.exe, see reply #3:
(http://www.jj2007.eu/pics/masm.bmp)

Which software did you use that gave you the distorted image?
Title: Re: masm pictures not getting recognized radasm
Post by: Greenhorn on December 08, 2023, 10:05:42 AM
See picture ...

Due to file size limitation for upload I had to use a filehoster.

EDIT: My web.de mailer is defect ?!

However, I used Pixelformer and does the job ...

Title: Re: masm pictures not getting recognized radasm
Post by: NoCforMe on December 08, 2023, 10:16:26 AM
I saved your image and converted it with my go-to paint program, Paint Shop Pro. Converted to 256-color image, saved as original PNG (and as a BMP which I couldn't upload). No degradation visible. You just need to use the right tool, apparently.

(It did strip the alpha-channel data from the image, and told me so, but you can see that it looks almost as good as the original.)
Title: Re: masm pictures not getting recognized radasm
Post by: stonelightning on December 08, 2023, 10:41:49 AM
Quote from: jj2007 on December 08, 2023, 09:55:03 AM
Quote from: stonelightning on December 08, 2023, 08:32:04 AMIt's with every image  :dazzled:
(https://i.postimg.cc/5Y2krnMV/masm.png) (https://postimg.cc/5Y2krnMV)

Processed with my ImageConverter.exe, see reply #3:
(http://www.jj2007.eu/pics/masm.bmp)

Which software did you use that gave you the distorted image?
normal paint in windows 11
Title: Re: masm pictures not getting recognized radasm
Post by: NoCforMe on December 08, 2023, 11:01:14 AM
Quote from: stonelightning on December 08, 2023, 10:41:49 AM
Quote from: jj2007 on December 08, 2023, 09:55:03 AMWhich software did you use that gave you the distorted image?
normal paint in windows 11

Hah; no wonder. I stay away from all those "default" Windoze paint programs, as they're fairly brain-damaged.

Get yourself a real picture editing program. Lots of free ones out there. I hear "gimp" is pretty good. Get a program so you don't have to rely on the online converters.