News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

large bmp file

Started by sudeer, November 14, 2008, 09:58:50 AM

Previous topic - Next topic

jj2007

Quote from: Mark Jones on November 16, 2008, 05:39:47 AM
Quote from: Mark Jones on November 16, 2008, 05:39:15 AM
Oh god, here we go again... Whatever.

Calm down, young friend. I just wanted to spare you from the doubtful honour to be the first on the Big World Wide Web who declared png a lossy format.

Vortex

Hi sudeer,

Attached is a demo displaying an image with BitmapFromFile

[attachment deleted by admin]

Mark Jones

Quote from: jj2007 on November 16, 2008, 09:36:25 AM
Quote from: Mark Jones on November 16, 2008, 05:39:15 AM
Oh god, here we go again... Whatever.

Calm down, young friend. I just wanted to spare you from the doubtful honour to be the first on the Big World Wide Web who declared png a lossy format.

Of course, young friend, if you considered the possibility that you are not the only person on the planet, then you might see why saying that PNG is "less lossy" is the general perceivable case and therefore a valid concept in spite of the PNG format itself being lossless, since dithering and color reduction are common methods implemented to reduce the filesize of PNGs. (Note, PNGs are still much larger than JPEGs in most optical cases.) Furthermore, PNG images containing large luma and chroma variances benefit most from the "reduce color and dither" methodology, since these images are natively much larger in PNG format than JPEG (upwards of 15x larger or more.) Lineart and other low-color images should not need dithering at all -- the LZ77 compression is excellent in this case.

For your enjoyment, eight images are available here. These images illustrate why dithering PNGs is a good idea. Two comparisons are given: truecolor optical data, and truecolor lineart data. For the optical comparison, image 1 is an uncompressed DV bitmap. 2) is a typical compressed JPEG of image one. 3) is an un-modified, lossless 24-bit truecolor PNG of image one. And 4) is a color-reduced and dithered PNG version of image one. The second set of images mirror the first set, but utilize lineart source data. Examine these filesizes and image qualities and then tell me wether or not it is important to consider "lossy" PNG implementation as a general-case for truecolor optical data.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

jj2007

Thanks, Mark. Your reply is now definitely more detailed than "...less lossy png...", which I found inappropriate, especially in The Campus. Still, I can't find a good reason why anybody would prefer a lousy quality 406881 bytes png image to a top quality 151672 bytes jpg version. Load 1.bmp, 2.jpg and 4.png into PaintShop and press repeatedly Control F6 to see the difference. IMHO an image with 75103 different colours is commonly called a "photo", and the appropriate format for a photo is lossy jpg, not "lossy png".

sudeer

hi.....
i have done it, thanks to every body especially to "Vortex", the file size redused from 177MB to less than 1 MB

ShowPage proc uses eax ebx numb:dword
   m2m      ebx,numb
   .if      ebx <= 272*4
   invoke   GetCurrentDirectory,sizeof FindBuffer,addr FindBuffer
   invoke   lstrcat,addr FindBuffer,Q_BMP1[ebx]
   invoke   BitmapFromFile,addr FindBuffer
   mov      hBmp1,eax
   invoke   ShowBmp,hBmp1,hBmpPage
   .endif
   ret
ShowPage endp

THANKS AGAIN

Vortex

Hi sudeer,

You are welcome. Note that the BitmapFromFile function is not limited with bitmaps :

QuoteDescription

BitmapFromFile returns a bitmap handle from an image file.
An image may be in either .bmp, .gif, .jpg, or .wmf format