CDAT / cdat

Community Data Analysis Tools
Other
175 stars 68 forks source link

export patterns / hatches as vectors for vector formats #2072

Closed aashish24 closed 7 years ago

aashish24 commented 8 years ago

@doutriaux1 @danlipsa

sankhesh commented 8 years ago

@aashish24 @doutriaux1

Could you please validate if these images are good:

test_fillarea.pdf

test_fillarea_list.pdf

aashish24 commented 8 years ago

@sankhesh this is close but I see one problem. You see that image is "bitmap" so you see these jagged edges. what we need is a smoothing filter. Talk to Will or David Gobi about it.

sankhesh commented 8 years ago

@aashish24 Figured out why there were those jagged edges. That area was still being exported raster graphics. After my fix, the file size is tremendously huge. The test_fillarea.pdf file is ~ 287MB and test_fillare_list.pdf is ~ 498MB. Any ideas to reduce the size?

aashish24 commented 8 years ago

Can you drop one of the files on google drive?

I think the fix would be to exact the edges and export them vs exporting the triangles. Although it may not help all the patterns since each triagle may still be a separate. I guess one other thing would be to get rid of complete transparent triangles (this should be doable). Do you want to try that?

sankhesh commented 8 years ago

https://drive.google.com/file/d/0Bxgq5zla1NcFc2Q3T1FPb2JJamM/view?usp=sharing

sankhesh commented 8 years ago

@aashish24 I get rid of transparent triangles and the file size reduced to half but these are still pretty large files. See PR #2115.

The test script I use is listed here: https://github.com/UV-CDAT/uvcdat/issues/541#issue-39712768

aashish24 commented 8 years ago

great @sankhesh. Can you tel me the diff

1) file size exported from master of cdat 2) file size exported from your branch

I am wondering if the diff between 1) and 2) is not that much and 1) is large itself.

danlipsa commented 8 years ago

@aashish24 @sankhesh These are the pdf files generated by uvcdat 1.5.1. Initially I thought they are raster - as it takes a while to render in okular. It seems that they are paths though.

test_fillarea_list.pdf test_fillarea.pdf

doutriaux1 commented 8 years ago

@danlipsa but hey were happy with the quality of the output. That's the main difference, current pdf are unusable (only quoting)

sankhesh commented 8 years ago

@aashish24 Based on our discussion, I am looking at alternative ways to vectorize the output graphics. I looked at potrace, but that only works for black and white graphics and has no color support.

Next, I found autotrace. That seems like it may work for our needs. Here are some example outputs generated using autotrace:

Seems like it works good and the size is also not exorbitant, except that text is not rendered well. Is there a way to disable font hinting?

sankhesh commented 8 years ago

@doutriaux1 @aashish24 @williams13 Just wanted to post a quick update on this issue:

Here is a test pdf: test_fillarea_list.pdf

You can see that it is merely 3.5MB and renders the patterns/hatches as vectors.

There are a few issues that I am working my way through but should have this ready soon.

aashish24 commented 8 years ago

@doutriaux1 what you think?

doutriaux1 commented 8 years ago

@aashish24 thx for pinging I didn't see that 3.5Mb seems right @sankhesh let me know when I can test

doutriaux1 commented 8 years ago

@sankhesh @bonfils2 noted the following:

doutriaux1 commented 8 years ago

FYI @bonfils2 needs to submit her paper within 2 weeks, so we need it in a branch more or less functional as soon as possible. Thanks!

sankhesh commented 8 years ago

@bonfils2

  • only 4 patterns shown

I am currently looking into some issues with the pattern generation. Once done, I plan to add more patterns

  • line width/distance seems to be not constant

Hmm. Not sure I see that. Could you please point out where this issue is?

  • triangles are not perfect

Yes, we've noticed that too. I'll fix it soon.

  • Can we control the size of squares/lines?

Currently, there is no such API in VCS. @doutriaux1 Should I just go ahead and add some properties to fillarea?

FYI @bonfils2 needs to submit her paper within 2 weeks, so we need it in a branch more or less functional as soon as possible. Thanks!

Sure, I'll try to get it done this week. Will have to work with you when selecting what kind of patterns.

doutriaux1 commented 8 years ago

@sankhesh I thought we were going to be able to send a fillarea object to the pattern, wouldn't that allow use to control the size of the patterns?

doutriaux1 commented 8 years ago

@sankhesh on horizontal lines the 5th and 6th lines (from bottom) seem to have different thickness

bonfils2 commented 7 years ago

Hello, There is progress with the patterns. Here is the figure I generated. As you can see, however, is that underneath the patterns, the background color is white while it should be light brown or light green. Thanks for looking into it! Bonfils_etal_droughts_Jan32017_FINAL_FIG2.pdf

sankhesh commented 7 years ago

@bonfils2 Thank you. I'll try to reproduce the issue on my end too. But just so I fully understand it, you add a solid fillarea (with the background color) and then a pattern on top it, right?

doutriaux1 commented 7 years ago

@sankhesh yes she has data and she wants to see them bellow the hatching.

sankhesh commented 7 years ago

@bonfils2 @doutriaux1 I just created the attached pdf using the latest VTK master and it seems like all issues (including hatch over solid fillarea) have been resolved.

vcs_patterns_index_10.pdf

vcs_patterns_index_10

williams13 commented 7 years ago

Fantastic! Can we get this checked out for the next release?

-Dean

From: Sankhesh Jhaveri notifications@github.com Reply-To: UV-CDAT/uvcdat reply@reply.github.com Date: Friday, January 13, 2017 at 11:45 AM To: UV-CDAT/uvcdat uvcdat@noreply.github.com Cc: Dean Williams williams13@llnl.gov, Mention mention@noreply.github.com Subject: Re: [UV-CDAT/uvcdat] export patterns / hatches as vectors for vector formats (#2072)

@bonfils2https://github.com/bonfils2 @doutriaux1https://github.com/doutriaux1 I just created the attached pdf using the latest VTK master and it seems like all issues (including hatch over solid fillarea) have been resolved.

vcs_patterns_index_10.pdfhttps://github.com/UV-CDAT/uvcdat/files/705172/vcs_patterns_index_10.pdf

[cs_patterns_index_10]https://cloud.githubusercontent.com/assets/936354/21943310/b78c1762-d99e-11e6-9170-5ca4cb506de9.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/UV-CDAT/uvcdat/issues/2072#issuecomment-272529747, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACrXKYQdabykIUxvimZ1FfNdUgx7IrQ3ks5rR9RJgaJpZM4Jb8es.