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

support webp output #27

Open
leafonsword opened this issue Nov 13, 2019 · 2 comments
Open

support webp output #27

leafonsword opened this issue Nov 13, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@leafonsword
Copy link

webp has better compression than png、jpg、gif, almost is the picture format king; hope support webp output~

@mcastorina mcastorina added the enhancement New feature or request label Nov 23, 2019
@mcastorina
Copy link
Owner

graph-cli uses matplotlib.pyplot to save figures. When trying to save a webp image, I get this error:

ValueError: Format 'webp' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)

I will investigate further, but as a workaround you can use cwebp to convert png to webp:

graph-cli ➤ graph samples/sine.csv -o test.png                                                                                       git:master*
graph-cli ➤ cwebp -q 60 test.png -o test.webp                                                                                        git:master*
Saving file 'test.webp'
File:      test.png
Dimension: 1600 x 1000
Output:    27544 bytes Y-U-V-All-PSNR 45.37 49.90 49.72   46.42 dB
           (0.14 bpp)
block count:  intra4:        792  (12.57%)
              intra16:      5508  (87.43%)
              skipped:      4811  (76.37%)
bytes used:  header:            327  (1.2%)
             mode-partition:   5376  (19.5%)
 Residuals bytes  |segment 1|segment 2|segment 3|segment 4|  total
    macroblocks:  |       1%|       3%|       6%|      91%|    6300
      quantizer:  |      45 |      45 |      39 |      32 |
   filter level:  |      14 |      10 |       8 |       5 |
graph-cli ➤ ls -lh test.*                                                                                                            git:master*
-rw-r--r-- 1 miccah miccah 69K Feb  2 22:31 test.png
-rw-r--r-- 1 miccah miccah 27K Feb  2 22:31 test.webp

@leafonsword
Copy link
Author

@mcastorina thx, since matplotlib doesn't support webp now, hope it could support later~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants