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

Replace diagram with smaller version (decreasing file size by 10x) #57

Conversation

eecavanna
Copy link
Contributor

@eecavanna eecavanna commented Nov 7, 2024

In this branch, I replaced a ~2.5 MB diagram with a ~250 KB version of itself. I generated the latter by importing the former into Photopea (a free, online alternative to Photoshop), then going to File > Export As > PNG and setting the width to 1920 pixels (that's the same width that a frame of "Full HD" video has). This will make operations involving the image faster (e.g. loading web pages that contain the image).

@eecavanna eecavanna self-assigned this Nov 7, 2024
@eecavanna eecavanna linked an issue Nov 7, 2024 that may be closed by this pull request
@eecavanna eecavanna requested a review from kaijli November 7, 2024 06:28
@eecavanna
Copy link
Contributor Author

Hi @kaijli, I opted to designate you, specifically, as the reviewer of this PR because GitHub shows you as the person that most recently committed changes to the file involved. You can reassign the PR if you want (I didn't know whether there are any existing conventions for "who reviews which PRs" in this repo).

@kaijli
Copy link
Contributor

kaijli commented Nov 7, 2024

If there's a specific dimension / density you'd like all the figures across workflows to be, let me know and i can generate them all pretty quickly!

@eecavanna
Copy link
Contributor Author

Thank you! I'm going to merge this in so I can see how it looks on the rendered web page.

Regarding general requirements—thanks for asking! I haven't put any thought into that yet.

For reference, I was motivated to address this specific image because, when I would generate the web page from it, it would look like this and the page would take several seconds to load:

image

I think one issue there is with Sphinx, itself (i.e. the software that turns the .rst file into a web page)—it is not constraining the image's dimensions the way I'd expect. But I consider the image size to be another issue—it is multiple MB.

I made this PR to address the latter issue, specifically—and I'll see (once I merge it in) whether it has an impact on the former issue (at this point, I'm still unsure how Sphinx will format the smaller image).

I would like to come up with some general "specifications" for the image files, though (thanks again for bringing that up). That way, the process is less trial-and-error and more prescriptive.

I'll get back to you on Slack about this once I've merged this PR in and seen how it affects the web page.

@eecavanna eecavanna merged commit 3b37711 into master Nov 7, 2024
1 check passed
@eecavanna eecavanna deleted the 56-reduce-file-size-of-graphic-in-documentation-currently-25-mb branch November 7, 2024 19:44
@eecavanna
Copy link
Contributor Author

eecavanna commented Nov 7, 2024

Update

The resulting web page looks like this:

image

On the plus side, the page loads faster and the image is all within view. But, the image's proportions still do not match its native ones (it's being stretched vertically).

In other words, I don't consider there to be anything wrong with this image file—yet the resulting web page is still "broken" (as shown above). I think this is a Sphinx issue (or an issue with the way the image is being referenced within the .rst file; e.g. the usage of the scale option). I will try to resolve that before getting into establishing a specification for the images, themselves.

@kaijli
Copy link
Contributor

kaijli commented Nov 7, 2024

We can change from .rst to a different file type, happy to do some copy pasting for things that are up to date as well as update to a new format for ones that need updates.

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.

Reduce file size of graphic in documentation (currently 2.5 MB)
2 participants