{"id":1756,"date":"2014-02-06T14:45:22","date_gmt":"2014-02-06T13:45:22","guid":{"rendered":"https:\/\/ridgesolutions.ie\/?p=1756"},"modified":"2014-02-06T15:09:05","modified_gmt":"2014-02-06T14:09:05","slug":"save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net","status":"publish","type":"post","link":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/","title":{"rendered":"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \/ .Net"},"content":{"rendered":"<p>It took me about 3 years to figure this out.  In .Net when you save an 8 bit bitmap from software (<em>PixelFormat.Format8bppIndexed<\/em>) via Save() it is saved by default in a compressed format (as is allowed by the <a href=\"http:\/\/en.wikipedia.org\/wiki\/BMP_file_format\">.bmp<\/a> pseudo-standard).<\/p>\n<p>Now some Machine Vision libraries can&#8217;t load compressed 8 bit bitmaps (poor old Cognex, bless) so I had to figure out how to get .Net to save the .bmp file in an uncompressed format.<\/p>\n<p>The following code save the bitmap as 8bit compressed (if the bitmap&#8217;s format is <em>PixelFormat.Format8bppIndexed<\/em>)<\/p>\n<pre>\r\n\r\n bitmap.Save(\"it.bmp\");\r\n\r\n<\/pre>\n<p>Now Microsoft has not documented this whole area very well, but it is quite easy, you have to manually specify an image encoder and set its &#8216;Compression&#8217; parameters as in the following code:<\/p>\n<pre>\r\n  \/\/ Make sure that the blighter will be saved\r\n  \/\/ uncompressed.\r\n  var enc = GetEncoderInfo(\"image\/bmp\");\r\n            \r\n  var parms = new EncoderParameters(1);\r\n         \r\n  var parm = new EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionNone);\r\n  parms.Param[0] = parm;\r\n\r\n  \/\/ Save the bitmap.\r\n  bitmap.Save(\"it.bmp\", enc, parms);\r\n<\/pre>\n<p>Where GetEncoderInfo() is defined as:<\/p>\n<pre>\r\nprivate static ImageCodecInfo GetEncoderInfo(String mimeType)\r\n{\r\n    int j;\r\n    ImageCodecInfo[] encoders;\r\n    encoders = ImageCodecInfo.GetImageEncoders();\r\n    for (j = 0; j < encoders.Length; ++j)\r\n    {\r\n        if (encoders[j].MimeType == mimeType)\r\n            return encoders[j];\r\n    }\r\n    return null;\r\n}\r\n<\/pre>\n<p>Here we set the <em>Encoder.Compression<\/em> parameter to <em>EncoderValue.CompressionNone<\/em> and this should ensure that the bitmap is saved uncompressed.<\/p>\n<p>See <a href=\"https:\/\/ridgesolutions.ie\/index.php\/2013\/02\/13\/c-save-grayscale-bytearray-image-byte-as-bitmap-file-bmp-example\/\">this<\/a> post for details of how to save an 8 bit greyscale image to disk from a byte array.<\/p>\n<p>Reference:<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ytz20d80(v=vs.110).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ytz20d80(v=vs.110).aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can&#8217;t load compressed 8 bit bitmaps (poor old Cognex, bless) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[313,57,191,67],"class_list":["post-1756","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bmp","tag-net","tag-bitmap","tag-c"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can&#039;t load compressed 8 bit bitmaps (poor old Cognex, bless)\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kevin Godden\"\/>\n\t<meta name=\"google-site-verification\" content=\"Kyj52YLp6GOPA44PVBffo9fjW8rgWHYYRF0ZYjfy6ss\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Systems and Embedded Software Engineering, Ireland. | Some thoughts of a busy Computer Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net\" \/>\n\t\t<meta property=\"og:description\" content=\"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can&#039;t load compressed 8 bit bitmaps (poor old Cognex, bless)\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2014-02-06T13:45:22+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2014-02-06T14:09:05+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net\" \/>\n\t\t<meta name=\"twitter:description\" content=\"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can&#039;t load compressed 8 bit bitmaps (poor old Cognex, bless)\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#article\",\"name\":\"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \\\/ .Net\",\"headline\":\"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \\\/ .Net\",\"author\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/wp-content\\\/uploads\\\/2013\\\/09\\\/ridge_logo1.jpg\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#articleImage\",\"width\":400,\"height\":81},\"datePublished\":\"2014-02-06T14:45:22+00:00\",\"dateModified\":\"2014-02-06T15:09:05+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#webpage\"},\"articleSection\":\"Uncategorized, .bmp, .NET, bitmap, c#\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ridgesolutions.ie\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"position\":2,\"name\":\"Uncategorized\",\"item\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#listItem\",\"name\":\"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \\\/ .Net\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#listItem\",\"position\":3,\"name\":\"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \\\/ .Net\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\",\"name\":\"Ridge Solutions, Software Development and Software Engineering, Ireland.\",\"description\":\"Some thoughts of a busy Computer Engineer\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/wp-content\\\/uploads\\\/2013\\\/09\\\/ridge_logo1.jpg\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#organizationLogo\",\"width\":400,\"height\":81},\"image\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/\",\"name\":\"Kevin Godden\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2833f41e59a25cf2a9741a05ec383bfdd278762a5e0798a90940e7ab0a107a2?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kevin Godden\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#webpage\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/\",\"name\":\"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \\\/ .Net\",\"description\":\"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can't load compressed 8 bit bitmaps (poor old Cognex, bless)\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2014\\\/02\\\/06\\\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"datePublished\":\"2014-02-06T14:45:22+00:00\",\"dateModified\":\"2014-02-06T15:09:05+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#website\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/\",\"name\":\"Ridge Solutions, Software Development and Software Engineering, Ireland.\",\"description\":\"Some thoughts of a busy Computer Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net","description":"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can't load compressed 8 bit bitmaps (poor old Cognex, bless)","canonical_url":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"Kyj52YLp6GOPA44PVBffo9fjW8rgWHYYRF0ZYjfy6ss","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#article","name":"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net","headline":"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \/ .Net","author":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"publisher":{"@id":"https:\/\/www.ridgesolutions.ie\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.ridgesolutions.ie\/wp-content\/uploads\/2013\/09\/ridge_logo1.jpg","@id":"https:\/\/www.ridgesolutions.ie\/#articleImage","width":400,"height":81},"datePublished":"2014-02-06T14:45:22+00:00","dateModified":"2014-02-06T15:09:05+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#webpage"},"isPartOf":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#webpage"},"articleSection":"Uncategorized, .bmp, .NET, bitmap, c#"},{"@type":"BreadcrumbList","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie#listItem","position":1,"name":"Home","item":"https:\/\/www.ridgesolutions.ie","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/#listItem","name":"Uncategorized"}},{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/#listItem","position":2,"name":"Uncategorized","item":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#listItem","name":"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \/ .Net"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#listItem","position":3,"name":"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \/ .Net","previousItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/#listItem","name":"Uncategorized"}}]},{"@type":"Organization","@id":"https:\/\/www.ridgesolutions.ie\/#organization","name":"Ridge Solutions, Software Development and Software Engineering, Ireland.","description":"Some thoughts of a busy Computer Engineer","url":"https:\/\/www.ridgesolutions.ie\/","logo":{"@type":"ImageObject","url":"https:\/\/www.ridgesolutions.ie\/wp-content\/uploads\/2013\/09\/ridge_logo1.jpg","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#organizationLogo","width":400,"height":81},"image":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author","url":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/","name":"Kevin Godden","image":{"@type":"ImageObject","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2833f41e59a25cf2a9741a05ec383bfdd278762a5e0798a90940e7ab0a107a2?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kevin Godden"}},{"@type":"WebPage","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#webpage","url":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/","name":"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net","description":"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can't load compressed 8 bit bitmaps (poor old Cognex, bless)","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.ridgesolutions.ie\/#website"},"breadcrumb":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/#breadcrumblist"},"author":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"creator":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"datePublished":"2014-02-06T14:45:22+00:00","dateModified":"2014-02-06T15:09:05+00:00"},{"@type":"WebSite","@id":"https:\/\/www.ridgesolutions.ie\/#website","url":"https:\/\/www.ridgesolutions.ie\/","name":"Ridge Solutions, Software Development and Software Engineering, Ireland.","description":"Some thoughts of a busy Computer Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.ridgesolutions.ie\/#organization"}}]},"og:locale":"en_US","og:site_name":"Systems and Embedded Software Engineering, Ireland. | Some thoughts of a busy Computer Engineer","og:type":"article","og:title":"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net","og:description":"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can't load compressed 8 bit bitmaps (poor old Cognex, bless)","og:url":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/","article:published_time":"2014-02-06T13:45:22+00:00","article:modified_time":"2014-02-06T14:09:05+00:00","twitter:card":"summary","twitter:title":"Save 8 bit uncompressed windows bitmap file (.BMP) in c# \/ .Net","twitter:description":"It took me about 3 years to figure this out. In .Net when you save an 8 bit bitmap from software (PixelFormat.Format8bppIndexed) via Save() it is saved by default in a compressed format (as is allowed by the .bmp pseudo-standard). Now some Machine Vision libraries can't load compressed 8 bit bitmaps (poor old Cognex, bless)"},"aioseo_meta_data":{"post_id":"1756","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-09-13 15:40:51","updated":"2025-07-15 22:34:04","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ridgesolutions.ie\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/\" title=\"Uncategorized\">Uncategorized<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tSave 8 bit uncompressed windows bitmap file (.BMP)  in c# \/ .Net\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.ridgesolutions.ie"},{"label":"Uncategorized","link":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/"},{"label":"Save 8 bit uncompressed windows bitmap file (.BMP)  in c# \/ .Net","link":"https:\/\/www.ridgesolutions.ie\/index.php\/2014\/02\/06\/save-8-bit-uncompressed-windows-bitmap-file-bmp-in-c-net\/"}],"_links":{"self":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts\/1756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/comments?post=1756"}],"version-history":[{"count":0,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts\/1756\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/media?parent=1756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/categories?post=1756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/tags?post=1756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}