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

Minified SVG Bamboo Lab Printer images #4513

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

yw4z
Copy link
Contributor

@yw4z yw4z commented Mar 16, 2024

Used this site https://svgomg.net
Minifier basically joins lines / curves with same style to reduce code. Doesn't change geometry
Size dropped to 2,02MB from 4,75MB
Couldn't tested on UI. Not sure how to do that

Used this site https://svgomg.net
Minifier basically joins lines / curves with same style to reduce size
Doesn't change geometry
Size dropped to 2,02MB from 4,75MB
Couldn't tested on UI. Not sure how to do that
Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

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

Cool, thanks!
Looks good to me

@SoftFever SoftFever merged commit 059acc7 into SoftFever:main Mar 18, 2024
@yw4z
Copy link
Contributor Author

yw4z commented Mar 18, 2024

@SoftFever Also i tried lossy compression on big png files. it gives 6-8MB size reduction in total with unnoticeable change. should i commit for that or do you prefer keeping them as lossless

@bistory
Copy link
Contributor

bistory commented Mar 18, 2024

@SoftFever Also i tried lossy compression on big png files. it gives 6-8MB size reduction in total with unnoticeable change. should i commit for that or do you prefer keeping them as lossless

Unfortunately, your changes will probably be overwritten and it will be hard to maintain compressed/uncompressed images easily if they are compressed with loss...

@yw4z
Copy link
Contributor Author

yw4z commented Mar 18, 2024

@bistory what's the reason for that? is png images regularly merged from bamboo studio or prusa slicer?

@bistory
Copy link
Contributor

bistory commented Mar 18, 2024

@bistory what's the reason for that? is png images regularly merged from bamboo studio or prusa slicer?

No, @SoftFever told me that people contributing new profiles regularly struggle with git and overwrite mangled images by uncompressed ones...

@yw4z
Copy link
Contributor Author

yw4z commented Mar 18, 2024

@bistory i'm pointing images in resources not in profiles. Size reduction gain is 6MB with this ones. also there is more in resources\web

oss_picture_loading.png
extrusion_calibration_tips_en.png
extrusion_calibration_tips_zh.png
fd_pattern_manual_result.png
fd_pattern_manual_result_CN.png
fd_pattern_manual.png
flow_rate_calibration_fine.png
flow_rate_calibration_coarse.png
fd_calibration_auto.png
temperature_record.png
fd_calibration_manual_result.png
fd_calibration_manual_result_CN.png
flow_rate_calibration_coarse_result.png
flow_rate_calibration_coarse_result_CN.png
flow_rate_calibration_fine_result.png
flow_rate_calibration_fine_result_CN.png
fd_calibration_manual.png
flow_rate_calibration_auto.png
cali_page_flow_introduction_CN.png
cali_page_flow_introduction.png
live_stream_default.png
temperature_calibration.png
cali_page_before_pa_CN.png
cali_page_before_pa.png
cali_page_after_pa_CN.png
cali_page_after_pa.png
cali_fdc_editing_diagram.png
cali_fdc_editing_diagram_CN.png
max_volumetric_speed_calibration.png
input_access_code_x1_en.png
input_access_code_n1_en.png
input_access_code_n1_cn.png
input_access_code_x1_cn.png
monitor_brokenimg.png
monitor_sdcard_thumbnail.png
media_loading.png
input_access_code_p1p_cn.png
input_access_code_p1p_en.png
printer_placeholder.png
oss_picture_load_failed.png

@SoftFever
Copy link
Owner

@bistory i'm pointing images in resources not in profiles. Size reduction gain is 6MB with this ones. also there is more in resources\web

oss_picture_loading.png extrusion_calibration_tips_en.png extrusion_calibration_tips_zh.png fd_pattern_manual_result.png fd_pattern_manual_result_CN.png fd_pattern_manual.png flow_rate_calibration_fine.png flow_rate_calibration_coarse.png fd_calibration_auto.png temperature_record.png fd_calibration_manual_result.png fd_calibration_manual_result_CN.png flow_rate_calibration_coarse_result.png flow_rate_calibration_coarse_result_CN.png flow_rate_calibration_fine_result.png flow_rate_calibration_fine_result_CN.png fd_calibration_manual.png flow_rate_calibration_auto.png cali_page_flow_introduction_CN.png cali_page_flow_introduction.png live_stream_default.png temperature_calibration.png cali_page_before_pa_CN.png cali_page_before_pa.png cali_page_after_pa_CN.png cali_page_after_pa.png cali_fdc_editing_diagram.png cali_fdc_editing_diagram_CN.png max_volumetric_speed_calibration.png input_access_code_x1_en.png input_access_code_n1_en.png input_access_code_n1_cn.png input_access_code_x1_cn.png monitor_brokenimg.png monitor_sdcard_thumbnail.png media_loading.png input_access_code_p1p_cn.png input_access_code_p1p_en.png printer_placeholder.png oss_picture_load_failed.png

Hehe, I appreciate your effort to make the file size smaller 👍 @yw4z @bistory
As long as we keep in mind they might be unintentionally reverted in the future.
The maintenance cost is a bit high to enforce it, so I will go easy with those kinds of changes in future PRs with such "reversions".

@BelleNottelling
Copy link

Hi, @SoftFever

Have you considered using something like imgbot?
It automatically crawls GH repos, optimizes images, and then submits a PR with a complete summary of all the images that were optimized.

I don't entirely know how it'll handle an image that was previously compressed getting reverted again, however it does watch the commit history and periodically will attempt to optimize all images if it hasn't done so in some time so it will eventually end up getting those images optimized once again.

Just a thought, cheers!

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.

4 participants