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

[py-tx][mlh] Add un-letterboxing reference implementation to Photo Content Type #1666

Open
Dcallies opened this issue Oct 22, 2024 · 0 comments
Labels
mlh Related to Major League Hacking Fellowship python-threatexchange Items related to the threatexchange python tool / library

Comments

@Dcallies
Copy link
Contributor

Goal:

Provide a method in Photo content type which, given an image, returns either the same image, or a smaller image that has square black boxes removed from the side.

Example

Take this image:
Image

Given this "letterboxed" version of the image, the return should be the first image.
Image

Demonstrating

Add a new flag to tx hash that will allow preprocessing steps for images

tx hash -s pdq photo original.png
pdq facefacefaceface

tx hash -s pdq photo letterboxed.png
pdq 0000faceface0000

tx hash -s pdq --preprocess=unletterbox letterboxed.png
pdq facefacefaceface 

Implementing

Try to avoid pulling in new dependencies if you can, even though there are a million libraries that might already solve this. Instead, take a look at the image libraries already included, such as Pillow - there is robust documentation.

Testing

Include a unittest that demonstrates the functionality, including edge cases you might consider. Use the bridge mod photos, either algorithmically updating them

@Dcallies Dcallies added python-threatexchange Items related to the threatexchange python tool / library mlh Related to Major League Hacking Fellowship labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlh Related to Major League Hacking Fellowship python-threatexchange Items related to the threatexchange python tool / library
Projects
Status: No status
Development

No branches or pull requests

1 participant