Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Feature Addition: NumberMyImage #16

Description

@LORDLYAMIGO

Feature Addition: NumberMyImage

Description

Implement a utility to convert a black and white bitmap image into a numerical representation and then encode that number in base64 format.

Requirements

  1. Input: Accept an image file as input.

    • If the input image is not in bitmap format, convert it to bitmap.
  2. Pixel-to-Number Mapping:

    • Assign 0 to black pixels and 1 to white pixels in the bitmap.
    • Read the bitmap pixel by pixel and construct a binary string representing the image.
  3. Conversion to Base64:

    • Convert the binary string obtained from the image into its decimal equivalent.
    • Encode the decimal number to base64 format.
  4. Output:

    • Print or save the base64 string representing the image.
  5. Error Handling:

    • Handle invalid inputs gracefully (e.g., non-image files or unsupported formats).
    • Provide informative error messages to users.

Additional Notes

  • Ensure the implementation is efficient for large images.
  • Use appropriate Python libraries for image processing (e.g., Pillow) and base64 encoding.
  • Include detailed comments and logs for clarity and debugging purposes.

Acceptance Criteria

  • The utility correctly converts any valid black and white image to its corresponding base64 representation.
  • Handles edge cases such as completely black/white images or non-bitmap inputs.
  • Outputs a clear and concise result.

Submission

  • Deadline: 29/12/24
  • Languages Allowed: Python or Rust
  • Refer to submission.txt in the submission folder for submission guidelines.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Points: 30everyoneFor competitive issues, best PRs are only merged, no need to assign yourselfopen-for-allAny one can work on it without getting assigned, every PR can merge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions