Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Addition: NumberMyImage #16

Closed
LORDLYAMIGO opened this issue Dec 23, 2024 · 0 comments
Closed

Feature Addition: NumberMyImage #16

LORDLYAMIGO opened this issue Dec 23, 2024 · 0 comments
Labels
everyone For competitive issues, best PRs are only merged, no need to assign yourself open-for-all Any one can work on it without getting assigned, every PR can merge Points: 30

Comments

@LORDLYAMIGO
Copy link
Member

LORDLYAMIGO commented Dec 23, 2024

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.
@LORDLYAMIGO LORDLYAMIGO added Points: 20 everyone For competitive issues, best PRs are only merged, no need to assign yourself open-for-all Any one can work on it without getting assigned, every PR can merge Points: 30 and removed Points: 20 labels Dec 23, 2024
@LORDLYAMIGO LORDLYAMIGO pinned this issue Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
everyone For competitive issues, best PRs are only merged, no need to assign yourself open-for-all Any one can work on it without getting assigned, every PR can merge Points: 30
Projects
None yet
Development

No branches or pull requests

1 participant