Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is better BMP or JPG?
Message
From
20/03/2009 21:36:11
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01390071
Message ID:
01390200
Views:
97
>>>PNG is usually smaller. JPG is also smaller than BMP.
>>
>>Thank you. I will have to check with the customer if he knows how to get his signature into a PNG file.
>
>PNG is similar to GIF and it's usually bigger than JPG.

Dmitry,

For the smallest size possible, in your case, a signature can saved in a MONOCHROME BMP, that means that you have to save it using the BMP encoder, set to 1bpp - one bit per pixel.

That means that each pixel will consume ONLY 1 BIT !!!!
That's indeed the biggest economy of space that you can have.


GIFs are also indexed images, and you can also save it as a GIF, set to 1bpp, but it is not that common.

If your scanner software does not offer the 1bpp BMP file saving, just save it to any kind of BMP format available, then use GdiPlusX to convert ir to BMP, and obtain the smallest image possible:

If you are interested in doing this, feel free to call me again for this conversion...
Basically you';ll need to add ALL these lines of code:
DO LOCFILE("System.App")

WITH _SCREEN.System.Drawing
   * Create a Bitmap object based on a BMP file.
   LOCAL loOriginalBmp AS xfcBitmap
   loOriginalBmp = .Bitmap.New(GETPICT())
   LOCAL loMonoChrBmp as xfcBitmap
   loMonoChrBmp = loOriginalBmp.GetMonochrome()
   * Save the created Monochromatic Bmp
   loMonoChrBmp.Save("c:\Monochromatic.bmp", .Imaging.ImageFormat.Bmp)
ENDWITH
RETURN
More info and other possible variations here:
http://weblogs.foxite.com/vfpimaging/archive/2007/05/26/3857.aspx


Hope this helps !

REgards

Cesar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform