Skip to content

Add: DecompressImage (Black and White)#29

Open
Danahirmt wants to merge 2 commits intomasterfrom
DecompressImage
Open

Add: DecompressImage (Black and White)#29
Danahirmt wants to merge 2 commits intomasterfrom
DecompressImage

Conversation

@Danahirmt
Copy link
Collaborator

No description provided.

@Danahirmt Danahirmt marked this pull request as ready for review December 11, 2025 18:33
@Danahirmt Danahirmt requested a review from siliconlad December 11, 2025 18:33
Copy link
Collaborator

@siliconlad siliconlad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things, otherwise looks good!

Comment on lines +108 to +109
stream = BytesIO(ros_msg.data)
img = Image.open(stream)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stream = BytesIO(ros_msg.data)
img = Image.open(stream)
img = Image.open(BytesIO(ros_msg.data))

stream = BytesIO(ros_msg.data)
img = Image.open(stream)

img = img.convert('L') # 'L' = 8-bit pixels, black and white
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a parameter to select the format that you want to convert the image to after decompression. By default I would not convert to anything.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants