Page 1 of 2

How can I improve image scaling in bmp2bmp()?

Posted: Sat Nov 03, 2018 8:58 pm
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)

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

Posted: Sat Nov 03, 2018 10:06 pm
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 ) 

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

Posted: Sat Nov 03, 2018 10:15 pm
by Eugene Lutsenko
Send a sample program or an example image?

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

Posted: Sun Nov 04, 2018 4:35 pm
by Auge_Ohr
Eugene Lutsenko wrote:Send a sample program or an example image?
Original Image and BMP2BMP() Image

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

Posted: Sun Nov 04, 2018 10:56 pm
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

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

Posted: Mon Nov 05, 2018 12:11 pm
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

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

Posted: Mon Nov 05, 2018 12:40 pm
by Eugene Lutsenko
I sent the wrong files. Hurried. Now send it to you

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

Posted: Mon Nov 05, 2018 11:07 pm
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.

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

Posted: Tue Nov 06, 2018 12:28 am
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.

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

Posted: Tue Nov 06, 2018 12:32 am
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: