How can I improve image scaling in bmp2bmp()?

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

How can I improve image scaling in bmp2bmp()?

#1 Post by Eugene Lutsenko »

If you reduce the resolution of the image in some image file viewer, you get a much higher quality image than is obtained using bmp2bmp(). How to solve this problem? I'm already thinking of replacing bmp2bmp() with an external image scaling program run from the command line. For example, ImageMagick for cygwin (http://rus-linux.net/MyLDP/consol/Image ... nsoli.html)

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: How can I improve image scaling in bmp2bmp()?

#2 Post by Auge_Ohr »

can you upload a Sample to test it ?

you can try GraBitBlt() instead of o:Draw()

Code: Select all

GraBitBlt( oTargetPS, oSourcePS, aTargetRect, aSourceRect ) 
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How can I improve image scaling in bmp2bmp()?

#3 Post by Eugene Lutsenko »

Send a sample program or an example image?

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: How can I improve image scaling in bmp2bmp()?

#4 Post by Auge_Ohr »

Eugene Lutsenko wrote:Send a sample program or an example image?
Original Image and BMP2BMP() Image
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How can I improve image scaling in bmp2bmp()?

#5 Post by Eugene Lutsenko »

Thank You, Jimmy!

No difference between "opaque" and "transparent" options bmp2bmp() visually I have not noticed. I send 4 files: original, compressed with two variants of bmp2bmp() and compressed to the same size (1366 x 768) using Microsoft Office Picture Manager. The difference in quality is obvious. This difference plays a role because the compressed file is displayed on a monitor of limited dimension. In the application folder of the Eidos system is saved and the original.

Maybe there is some program that can be accessed from the command line with parameters that can qualitatively reduce the resolution of graphic files. I asked a friend of the developer from Belarus how difficult it is to do. He said he'd do it today. In cygwin, too, there is such a possibility: https://www.ibm.com/developerworks/linu ... ry/l-graf/. But the problem is that this cygwin build weighs 137 MB in the archive, instead of 80 MB, which I now use.

This program from Belarus is now in the process of debugging. I tested it. The scaled images are of very high quality
Attachments
1.zip
(921.44 KiB) Downloaded 772 times

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: How can I improve image scaling in bmp2bmp()?

#6 Post by Auge_Ohr »

hm ... i do not see Difference in Files :?: do you mean small Fonts :?:

i wonder why you make a big (1800 x 900 Pixel) File when you know it have to be Shrink to 1366 x 699 Pixel
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How can I improve image scaling in bmp2bmp()?

#7 Post by Eugene Lutsenko »

I sent the wrong files. Hurried. Now send it to you

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How can I improve image scaling in bmp2bmp()?

#8 Post by Eugene Lutsenko »

Hey, Jimmy!

Send 3 file: SWOTDiagrCls0001-06.jpg (1920x1080), SWOTDiagrCls0001-06_Scaled1.jpg (1366x768 obtained with bmp2bmp()) and SWOTDiagrCls0001-06_scaled2.jpg (1366x768, obtained with the help of the program from Belarus). The difference in the quality of the last two files is obvious.

You're asking me why I'm making files with different resolutions. Many users Eidos system (http://aidos.byethost5.com/map3.php) have a screen resolution lower than 1920x1080 on the computers available to them. For them to display on the screen you need a scaled file. And I always create a quality 1920x1080 file and write to the folder for these files so that they can be used in publications and reports. If the user has a screen at 1920x1080, then I do not form the scaled files, but show the original quality.

The program from Belarus for image scaling will be included in the Eidos system and will be publicly available. The quality of its work is the same as the graphic viewers. But it is started with the Run Shell() command with the parameters that are in the text file. It's convenient. Now this program is in the process of fine-tuning.
Attachments
1.rar
(1.31 MiB) Downloaded 754 times

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: How can I improve image scaling in bmp2bmp()?

#9 Post by Auge_Ohr »

i see now what you mean

Xbase++ only use GDI Function so Result when Shrink will lose Pixel.
while you use Text/Font in your Image you can see bad Result.

external Viewer like IrfanView or even M$ Windows 10 Photo Apps will give better Result
i use System associated App with ShellExecuteA API Function instead of Runshell()

Code: Select all

   lSuccess := DllCall( "SHELL32.DLL", DLL_STDCALL, ;
                        "ShellExecuteA", APPDESKTOP() :GetHWND(), "open", cPath+cFile, ;
                        cParameter, CURDIR(), SW_NORMAL )
   DO CASE
      CASE lSuccess > 32 
         Retvar := .T.
greetings by OHR
Jimmy

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: How can I improve image scaling in bmp2bmp()?

#10 Post by hz_scotty »

Eugene Lutsenko wrote:Hey, Jimmy!

Send 3 file: SWOTDiagrCls0001-06.jpg (1920x1080), SWOTDiagrCls0001-06_Scaled1.jpg (1366x768 obtained with bmp2bmp()) and SWOTDiagrCls0001-06_scaled2.jpg (1366x768, obtained with the help of the program from Belarus). The difference in the quality of the last two files is obvious.

You're asking me why I'm making files with different resolutions. Many users Eidos system (http://aidos.byethost5.com/map3.php) have a screen resolution lower than 1920x1080 on the computers available to them. For them to display on the screen you need a scaled file. And I always create a quality 1920x1080 file and write to the folder for these files so that they can be used in publications and reports. If the user has a screen at 1920x1080, then I do not form the scaled files, but show the original quality.

The program from Belarus for image scaling will be included in the Eidos system and will be publicly available. The quality of its work is the same as the graphic viewers. But it is started with the Run Shell() command with the parameters that are in the text file. It's convenient. Now this program is in the process of fine-tuning.
Irfanview says for your files:
The resolution is
SWOTDiagrCls0001-06.jpg (1800x900),
SWOTDiagrCls0001-06_Scaled1.jpg (1366x699) and
SWOTDiagrCls0001-06_scaled2.jpg (1366x768).

:think:
best regards
Hans

Post Reply