Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6984349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:32:17+00:00 2026-05-27T18:32:17+00:00

When I do a b.Save(outputFilename, ImageFormat.Bmp); where b is a 16-bit bitmap it is

  • 0

When I do a

b.Save(outputFilename, ImageFormat.Bmp);

where b is a 16-bit bitmap it is saved with bitfields compression. How can I make C# save without using any compression?

This is what I did with the links that @Ben Voigt posted:

ImageCodecInfo myImageCodecInfo;
Encoder myEncoder ;
EncoderParameter myEncoderParameter;
EncoderParameters myEncoderParameters;

myEncoder = Encoder.Compression;
myImageCodecInfo = GetEncoderInfo("image/bmp");
myEncoderParameters = new EncoderParameters(1);

myEncoderParameter = new EncoderParameter(myEncoder, 
                     (long)EncoderValue.CompressionNone);
myEncoderParameters.Param[0] = myEncoderParameter;

b.Save(outputFilename, myImageCodecInfo, myEncoderParameters );

When I pass an 8-bit bitmap no compression is used. But when I pass a 16-bit RGB bitmap it still uses bitfields compression.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:32:18+00:00Added an answer on May 27, 2026 at 6:32 pm

    Bitmap in windows means DIB.

    “A device-independent bitmap (DIB) is a format used to define device-independent bitmaps in various color resolutions. The main purpose of DIBs is to allow bitmaps to be moved from one device to another (hence, the device-independent part of the name). A DIB is an external format, in contrast to a device-dependent bitmap, which appears in the system as a bitmap object (created by an application…). A DIB is normally transported in metafiles (usually using the StretchDIBits() function), BMP files, and the Clipboard (CF_DIB data format).”

    And as we have discussed already in comments ,BITFIELDS compression is only used in 16 and 32 bit DIBs, and simply describes how the data is packed. In the case of a 16-bit DIB it can define the resolution of the green channel (i.e. 5:6:5 or 5:5:5), where as for 32-bit DIBs it defines whether the data is stored in RGB or BGR order (and, when using a BMIHv4/5 header, whether the alpha channel is used.)

    There is only one reason to it. It is to keep the BMP to be device independent which is about the format being independent of the device it may be used in. So it means, its always kept in a DIB format according to Windows ! The format is kept intact by means of the compression.

    EncoderParameters codecParams = new EncoderParameters(1);
    codecParams.Param[0] = new EncoderParameter(Encoder.Quality, 100L); 
    b.Save(outputFilename, myImageCodecInfo, codecparams ); 
    

    This should ensure your quality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i save in mysql database the time using NOW() function. how can i change
I save bitmap as jpg file. The source code is: imageView = new ImageView(this);
when save() executes this.reset() or that.reset() it can't find the reset() method and says
I save some values from database using this function (i've been replaced Vector, because
I save all the tasks in the activity manager by using this code List<ActivityManager.RunningAppProcessInfo>
Save me from raptor death - is there any better way to handle this
I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well,
I need to save a user's login information in encrypted form for this application
i save a user like this in doctrine: $user = User(); $user->name = 'peter';
I save preferences in one activities but not able to get saved preferences in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.