shahinrostami / plotapi

Engaging visualisations, made easy.
https://plotapi.com
MIT License
268 stars 17 forks source link

to_png('out.png') how to set dpi ? Cause output pic is fuzzy #41

Closed WuJunxu closed 3 years ago

shahinrostami commented 3 years ago

Hello @WuJunxu!

I can look into this with more information:

Can you please share the code you're using to generate the fuzzy-looking PNG, and also the PNG itself?

Thank you

WuJunxu commented 3 years ago

Hello @WuJunxu!

I can look into this with more information:

Can you please share the code you're using to generate the fuzzy-looking PNG, and also the PNG itself?

Thank you

Thanks for your reply.

Not exactly fuzzy, when the image zoomed in, the detail in not so clear, maybe the output image with low dpi(dots per inch). I used the code from the PDF Guide, as followings:

''' From chord import Chord matrix= [[22,33,44],[12,43,18],[45,98,28]] names=['A','B','C'] Chord(matrix,names).to_png('out.png') '''

I wonder how I could get the higher dpi image? Just like Python matplotlib.pyplot.savefig('xx'.png,dpi=300)

shahinrostami commented 3 years ago

Hello @WuJunxu! I can look into this with more information: Can you please share the code you're using to generate the fuzzy-looking PNG, and also the PNG itself? Thank you

Thanks for your reply.

Not exactly fuzzy, when the image zoomed in, the detail in not so clear, maybe the output image with low dpi(dots per inch). I used the code from the PDF Guide, as followings:

''' From chord import Chord matrix= [[22,33,44],[12,43,18],[45,98,28]] names=['A','B','C'] Chord(matrix,names).to_png('out.png') '''

I wonder how I could get the higher dpi image? Just like Python matplotlib.pyplot.savefig('xx'.png,dpi=300)

Ah, I see what you mean. There's currently no configuration available for the to_png() function in Chord Pro, however, you can achieve what you're after with .to_pdf()! If you use .to_pdf() you should be able to zoom in as much as you'd like, e.g.:

Screenshot 2021-05-15 at 19 36 34

This way you can take a screenshot of any level of detail, or even export that PDF as a PNG with your desired DPI and so on.

I hope this helps - please let me know if it does!

I'll close this comment but add the dpi configuration for to_png() to the feature request stack :)

WuJunxu commented 3 years ago

Hello @WuJunxu! I can look into this with more information: Can you please share the code you're using to generate the fuzzy-looking PNG, and also the PNG itself? Thank you

Thanks for your reply. Not exactly fuzzy, when the image zoomed in, the detail in not so clear, maybe the output image with low dpi(dots per inch). I used the code from the PDF Guide, as followings: ''' From chord import Chord matrix= [[22,33,44],[12,43,18],[45,98,28]] names=['A','B','C'] Chord(matrix,names).to_png('out.png') ''' I wonder how I could get the higher dpi image? Just like Python matplotlib.pyplot.savefig('xx'.png,dpi=300)

Ah, I see what you mean. There's currently no configuration available for the to_png() function in Chord Pro, however, you can achieve what you're after with .to_pdf()! If you use .to_pdf() you should be able to zoom in as much as you'd like, e.g.:

Screenshot 2021-05-15 at 19 36 34

This way you can take a screenshot of any level of detail, or even export that PDF as a PNG with your desired DPI and so on.

I hope this helps - please let me know if it does!

I'll close this comment but add the dpi configuration for to_png() to the feature request stack :)

Hello @WuJunxu! I can look into this with more information: Can you please share the code you're using to generate the fuzzy-looking PNG, and also the PNG itself? Thank you

Thanks for your reply. Not exactly fuzzy, when the image zoomed in, the detail in not so clear, maybe the output image with low dpi(dots per inch). I used the code from the PDF Guide, as followings: ''' From chord import Chord matrix= [[22,33,44],[12,43,18],[45,98,28]] names=['A','B','C'] Chord(matrix,names).to_png('out.png') ''' I wonder how I could get the higher dpi image? Just like Python matplotlib.pyplot.savefig('xx'.png,dpi=300)

Ah, I see what you mean. There's currently no configuration available for the to_png() function in Chord Pro, however, you can achieve what you're after with .to_pdf()! If you use .to_pdf() you should be able to zoom in as much as you'd like, e.g.:

Screenshot 2021-05-15 at 19 36 34

This way you can take a screenshot of any level of detail, or even export that PDF as a PNG with your desired DPI and so on.

I hope this helps - please let me know if it does!

I'll close this comment but add the dpi configuration for to_png() to the feature request stack :)

It really works! Thank you.