krysanify / androidsvg

Automatically exported from code.google.com/p/androidsvg
0 stars 0 forks source link

Rendered SVG Picture is blurry. #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. read svhttps://code.google.com/p/androidsvg/issues/entryg resource from 
input stream stored inside a jar file
2. renderToPicture
3. set PictureDrawable to a ImageView.

What is the expected output? What do you see instead?
The image renders, however the image is blurry. 

What version of the product are you using? On what operating system?
news beta version. android 4.02

Please provide any additional information below.

Original issue reported on code.google.com by kenneth....@gmail.com on 3 Jul 2014 at 4:27

GoogleCodeExporter commented 9 years ago
Hi. Thanks for the report.

Can you attach a screenshot of what you are getting?  And, if possible, the SVG 
file as well?

Original comment by paul.leb...@gmail.com on 3 Jul 2014 at 8:41

GoogleCodeExporter commented 9 years ago
As you can see the web browser rendered version is crisp and sharp where as the 
android is blurry.. maybe it's a anti-alias thing but doesn't see as sharp as 
vector graphics should be imo.

Thanks for your time looking into this. I'm looking to use this library in my 
next project and need good clear and sharp graphics.

Original comment by kenneth....@gmail.com on 4 Jul 2014 at 6:07

Attachments:

GoogleCodeExporter commented 9 years ago
I've even attempted to put the svg in the assets folder and reading it via an 
input stream. i get the same results.

Original comment by kenneth....@gmail.com on 4 Jul 2014 at 6:09

GoogleCodeExporter commented 9 years ago
Can you show me (or send me) the code you are using to render the SVG please?  
To me it is looking like the SVG has been rendered into a bitmap that has then 
been scaled up.

Original comment by paul.leb...@gmail.com on 4 Jul 2014 at 8:18

GoogleCodeExporter commented 9 years ago
Here is my simple example code i'm using... Regardless of where i pull the SVG 
source file, i get the same results.       

        SVGImageView imageView = new SVGImageView(this);
        imageView.setBackgroundColor(Color.WHITE);
        try {
            InputStream open = getAssets().open("test/Test.svg");
            SVG svg = SVG.getFromInputStream(open);
            Picture renderToPicture = svg.renderToPicture();
            Drawable drawable = new PictureDrawable(renderToPicture);
            imageView.setImageDrawable(drawable);
        } catch (Exception e) {
            Log.e("MainActivity", "Unable to open SVG File. " + e);
        }

Original comment by kenneth....@gmail.com on 4 Jul 2014 at 8:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Your code looks okay. Although when using the SVGImageView in AndroidSVG, all 
you should need to do is:

SVGImageView imageView = new SVGImageView(this);
imageView.setBackgroundColor(Color.WHITE);
imageView.setImageAsset("test/Test.svg");

You should be getting crisp graphics.  Assuming there is nothing especially 
weird about your SVG file.  Is it just the simple path or polygon that it looks 
like?

Perhaps you could send me the rest of that source file?  Maybe I can spot 
something that isn't obvious from this mall code sample.

Another thing that is odd is the difference in how those two stars turned out.  
As if the fill-rule was not being handled properly.  AndroidSVG should be 
rendering that correctly.

Original comment by paul.leb...@gmail.com on 4 Jul 2014 at 12:29

GoogleCodeExporter commented 9 years ago
Yeah, totally understand that logic. I'll send the example file when i get home 
this evening. It looks to me as if the whole thing lack clarity. Like every 
element is being recognized, and rendered, but when it come to displaying the 
graphic it seems to be losing quality. I've seen this a few times within java 
graphics rendering and perhap it's just me.... however with the code being as 
simple and by example as possible it just seems as if something is not quite 
right.

Original comment by kenneth....@gmail.com on 7 Jul 2014 at 5:56

GoogleCodeExporter commented 9 years ago
Sorry for the late reply, been really busy lately. I've attached a copy of a 
test sag that is also blurry... i can't seem to find the old  file.

Original comment by kenneth....@gmail.com on 15 Jul 2014 at 7:20

Attachments:

GoogleCodeExporter commented 9 years ago
The yellow car file seems to work fine for me.  It doesn't come out blurry.  
Here is a screenshot from my test program.

Original comment by paul.leb...@gmail.com on 16 Jul 2014 at 4:17

Attachments:

GoogleCodeExporter commented 9 years ago
Here's my result on a Samsung Galaxy 10.1 (4.0.2)

Original comment by kenneth....@gmail.com on 16 Jul 2014 at 2:28

Attachments:

GoogleCodeExporter commented 9 years ago
How are you creating these screenshots?  The screen grab feature built into 
Android saves PNGs.

Even the text is blurry in your screenshots, which presumably it is not the 
case in the on-screen version.  So clearly the conversion to JPEG is causing 
some of the problem.

Can you send me a proper (ie PNG) screen grab please. To do that, press Volume 
Down and the Power button at the same time.

Original comment by paul.leb...@gmail.com on 16 Jul 2014 at 2:33

GoogleCodeExporter commented 9 years ago
I'm using the built in capture... The screen looks just like the image though. 
Seems as if the button combination doesn't work.

Original comment by kenneth....@gmail.com on 16 Jul 2014 at 2:57

GoogleCodeExporter commented 9 years ago
You have to hold them both down for a second or two.  If you are not using 
that, then what "built-in" capture are you using?

Please send a PNG, not a JPEG.

Original comment by paul.leb...@gmail.com on 16 Jul 2014 at 3:36

GoogleCodeExporter commented 9 years ago
Both screenshots look the same. I can send it if you want but i don't see any 
differences.

Original comment by kenneth....@gmail.com on 16 Jul 2014 at 4:40

GoogleCodeExporter commented 9 years ago
Could you explain how you are creating your JPEG screenshots please?  And what 
method you used to create the PNG one.

Also what device are you testing on, and which version of Android?

Original comment by paul.leb...@gmail.com on 16 Jul 2014 at 9:17

GoogleCodeExporter commented 9 years ago
The first image was just the built in default screenshot tool. The other one 
was the method you suggested. Both saves the screen shot to the gallery. I'm 
using a Galaxy Tab 10.1 running 4.0.2. On the screen it's blurry, so when i 
save a snapshot it renders the screen accurately to an image that is equally 
blurry.

Original comment by kenneth....@gmail.com on 17 Jul 2014 at 6:11

GoogleCodeExporter commented 9 years ago
Ah, I see, you were talking about the screen capture that Samsung put into 
their version of Android.  The only "official" screenshot tool is the one 
Google added in the Ice Cream Sandwich release.

Since the blurriness also affects the text in the title bar.  I have to assume 
that it is some issue with your device, or perhaps your tablet settings.  It 
doesn't seem like it could be an issue with AndroidSVG.

So, for now, I'm going to close this issue as "Invalid".  If you disagree, 
follow-up and we can discuss further.

Best of luck finding the answer.

Original comment by paul.leb...@gmail.com on 17 Jul 2014 at 8:52