.net - Why are JPEG images created with System.Drawing larger than original Bitmaps? -


I have a strange problem - I have approximately 14.5 million bitmap images, which are estimated uncompressed, let me get these bitmaps in JPG Need to convert and store them in the database.

When I use the classes given in the .NET System.Drawing Library, save ImageModf as ImageFormat.Jpeg, about the resulting JPEG original bitmap size Two Bar Here's the code:

  Byte [] bitmapBytes = // (Receive from DB using the memory stream bitmapstream = new memorystream (bitmapbait) (bitmap bitmap = (bitmap) ) Bitmap frostream (bitmapstream) {bitmap.ave ("jpg.jpg", ImageFormat.Jpeg) ; }}  

I have seen many of these pictures through hex, and it seems that the compression setting is "none" so I assume that they are uncompressed. Additionally, the hex is the "BMP" code for the original file, and as a result the file contains the "JFIF" code as you want it.

The images are black and white, no color.

Any idea why this is happening? Looking for pointer in the right direction ...

Editing:

  • I have tried to use an alternative surcharge to save that allows you to specify the quality is. No benefits were seen.
  • I should also specify that I have stuck with JPEG to some extent here. This is a legacy system and JPEG is expected in other parts of the system.

Image attributes:

  • Bitmap dimensions: 152x48
  • Bitmap
  • JPEG size: 2.2 KB
  • Li>
  • bitmap information: indexed, 1 layer (2 colors)
  • file size: 1022 bytes
  • JPEG: same dimension
  • bitmap resolution: 96.012 X 96.012 ppi
  • This is probably because JPG images are now 24 bit RGB color images Saving, where bitmap 1bpp is black and white images.

    If bitmap is 1bpp, then jpg is probably not the best format to change them.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -