Edit screenshots to reduce file size #1102
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR reduces the size of 5 images that show screenshots of code in an editor. They're shown across 2 pages:
These are some of the largest images in the docs. They're now reduced to about 15-20% of their original file size:
breakpoint_hit.png
: 610KB -> 98KB, 16%breakpoint_set.png
: 536KB -> 79KB, 15%config_add.png
: 518KB -> 75KB, 15%sfc-with-preprocessors.png
: 160KB -> 32KB, 20%sfc.png
: 111KB -> 21KB, 19%For the cookbook page this is a reduction of about 1.4MB.
I used GIMP to reduce the file size. The process was:
I then reapplied the rounded corners and drop shadow using CSS. It won't be a perfect match for what was there before but I think I got it pretty close.
I haven't resized the images (aside from the cropping). That could have reduced the file size further but I didn't think it was worth it. I would assume that having relatively large images helps to keep them rendering clearly at different sizes and resolutions.
Changing to 255 colours could, in theory, impact the quality of the image. In practice, they look the same to me. The original images are still in the Git history should we ever need them.
I applied the CSS using
style
attributes. That seemed to be how custom styles were applied elsewhere, though I'd usually useclass
instead. I suppose that might be to ensure that the styles aren't lost by theme updates?