Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add possibility to set for BitmapRenderer to output monochrome images at a color depth of 1 bit per pixel?

Open
#465 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
desktop-dev

Research direction

Start in Source/lib/renderer/BitmapRenderer.cs, where the output Bitmap is created with Format24bppRgb. Read how the bitmap is drawn, then decide how a 1-bit option would be exposed and whether a black and white palette must be set for Format1bppIndexed. Done when a renderer setting produces a Format1bppIndexed image and the default output is unchanged. The RawFormat bonus is a separate question and may need its own decision.

Written by the indexing model from the issue text.

Description

Currently BitmapRenderer output images having a PixelFormat of Format24bppRgb, but since barcodes are 99% of the times black & white (monochrome), it would be nice to set the format to Format1bppIndexed.
As a bonus, it would be nice to have the RawFormat property of Bitmap (Image) to a value different than ImageFormat.MemoryBmp since the method ImageFormat.FindEncoder can't find an encoder for MemoryBmp and I experience crashes when using POS for .NET and printing that barcode with the PosPrinter.PrintMemoryBarcode method.
Thanks!

Dominant language
C#
Stars
3.1k
Forks
704
Avg merge
13d 17h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from micjahn/ZXing.Net

All issues in micjahn/ZXing.Net

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.