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

Automatically cropping screenshots #227

Open
fedarko opened this issue Mar 31, 2022 · 1 comment
Open

Automatically cropping screenshots #227

fedarko opened this issue Mar 31, 2022 · 1 comment

Comments

@fedarko
Copy link
Member

fedarko commented Mar 31, 2022

Esp. with relatively linear graphs, the view of the full graph often includes a lot of white space on the top and bottom of the image. For example:

6104

It doesn't seem like Cytoscape.js has functionality to automatically "crop" the image (remove white space), and it'd be really nice if this were included (since as it is currently, the extra space takes up a lot of room when including these visualizations in a paper).

I thiiiink this might be possible to do after we get the base64-encoded image from Cytoscape (see here), but this might rely on adding some fancy JS dependencies (and then the question becomes "is this worth it"). Would be easier to set up a Python / shell script or something to distribute with mgsc that auto-crops a directory of images, or something.

@fedarko
Copy link
Member Author

fedarko commented Mar 31, 2022

Ahhh, yeah, we can just use imagemagick (see here):

$ convert mgsc.png -trim mgsc-cropped.png

Can probably just add something to the docs that describes how to apply this to many screenshots at once.

something something xkcd alt text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant