-
Notifications
You must be signed in to change notification settings - Fork 373
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
Added support for creating multi-resolution stacks with upload_image.py #2411
Conversation
I definitely thing |
Yes, some cursory testing I just did showed 2.8MB -> 1.9MB with default setting, 1.8MB with brute force (2.5min though!). There doesn't seem to be a nice python package, so I'll have to get the binary installed via the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
…py (#2411) ### What Create and upload multi-resolution stacks with `upload_image.py` Clock example screenshot updated as an example of the result obtained. Relates to #2273 TODO: - [x] pngcrush stuff? - [x] docs - [x] test with jpg as well ### Usage ```sh $ just upload --help python3 "scripts/upload_image.py" --help usage: upload_image.py [-h] [--single] [--name NAME] [--skip-pngcrush] [--debug] [path] Upload an image. positional arguments: path File path to the image. If not provided, use the clipboard's content. options: -h, --help show this help message and exit --single Upload a single image instead of creating a multi-resolution stack. --name NAME Image name (required when uploading from clipboard). --skip-pngcrush Skip PNGCrush. --debug Enable debug logging. ``` ### Example output ``` INFO:root:Base image width: 2348px INFO:root:Resizing to: 480px INFO:root:Resizing to: 768px INFO:root:Resizing to: 1024px INFO:root:Resizing to: 1200px INFO:root:pngcrush reduced size from 76341 to 71599 bytes INFO:root:Uploading 30a2659cb4f9b6ac39c808c3312a3f89b71d040c_clock_480w.png (size: 71599, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 145632 to 134514 bytes INFO:root:Uploading acfb95102e353d67d0525e3a3d40fbe7f0ed638f_clock_768w.png (size: 134514, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 208771 to 188959 bytes INFO:root:Uploading 7b1b0435cd8de9318c301036853d5c0d190b155f_clock_1024w.png (size: 188959, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 254562 to 231188 bytes INFO:root:Uploading 51938f84bdb0df1baa1d72e09f2a1daac6e66d1c_clock_1200w.png (size: 231188, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 293024 to 265268 bytes INFO:root:Uploading 4040806d866f246eda1a1434f3a1ab083764eb56_clock_full.png (size: 265268, type: image/png, encoding: None) <picture> <source media="(max-width: 480px)" srcset="https://static.rerun.io/30a2659cb4f9b6ac39c808c3312a3f89b71d040c_clock_480w.png"> <source media="(max-width: 768px)" srcset="https://static.rerun.io/acfb95102e353d67d0525e3a3d40fbe7f0ed638f_clock_768w.png"> <source media="(max-width: 1024px)" srcset="https://static.rerun.io/7b1b0435cd8de9318c301036853d5c0d190b155f_clock_1024w.png"> <source media="(max-width: 1200px)" srcset="https://static.rerun.io/51938f84bdb0df1baa1d72e09f2a1daac6e66d1c_clock_1200w.png"> <img src="https://static.rerun.io/4040806d866f246eda1a1434f3a1ab083764eb56_clock_full.png" alt=""> </picture> ``` ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [ ] I've included a screenshot or gif (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2411 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/479fa5f/docs Examples preview: https://rerun.io/preview/479fa5f/examples <!-- pr-link-docs:end -->
### What This PR updates the examples' READMEs with new screenshots and adds the `thumbnail:` entry to their front matter. This uses #2411 and highlighted some bugs with it, to be fixed in a follow-up PR. TODO: - [x] deal with signed_distance_fields - [x] deal with detect_and_track_objects - [x] deal with ros_node ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a WHOLE LOT of screenshots in the PR <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2440 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/b2d508b/docs Examples preview: https://rerun.io/preview/b2d508b/examples <!-- pr-link-docs:end -->
What
Create and upload multi-resolution stacks with
upload_image.py
Clock example screenshot updated as an example of the result obtained.
Relates to #2273
TODO:
Usage
Example output
Checklist
PR Build Summary: https://build.rerun.io/pr/2411
Docs preview: https://rerun.io/preview/479fa5f/docs
Examples preview: https://rerun.io/preview/479fa5f/examples