Giter Club home page Giter Club logo

Comments (17)

redwarp avatar redwarp commented on August 17, 2024

Can you link the incriminated images and settings?

from 9-patch-resizer.

bersaty avatar bersaty commented on August 17, 2024

In file "densities.json":

    {
        "scale": 4,
        "name": "xxxhdpi",
        "active": true
    },
    {
        "scale": 2,
        "name": "xhdpi",
        "active": true
    },

Left is the default icon xxxhdpi(240x240) , right is convert to
xhdpi(120x120), you can see the blurring edage beside the characters;
bottom is the xxxhdpi(output density);

When select output density xxxhdpi , the output image's volume is bigger
than the default image.

[image: 内嵌图片 1]

[image: 内嵌图片 2]
2014-11-21 0:02 GMT+08:00 redwarp [email protected]:

Can you link the incriminated images and settings?


Reply to this email directly or view it on GitHub
#18 (comment)
.

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

Hi, somehow the images didn't get link. To link them, got on the issue's address on Github (#18), instead of using an email to reply.

Thanks in advance !

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

Hello. I looked up your samples, and well, here are my conclusions:
With the current resizing algorithm, there is nothing I can do to make it look better.

When you create an asset that's half the size, the resize algorythm use "blinear interpolation" (http://en.wikipedia.org/wiki/Bilinear_interpolation) but, according to Wikipedia: "Bilinear interpolation tends, however, to produce a greater number of interpolation artifacts (such as aliasing, blurring, and edge halos) than more computationally demanding techniques such as bicubic interpolation.

Let's take your xxxhdpi image for exemple: the first B on the left starts at pixel column 67. So an uneven number. With a bilinear interpolation, it tries to smooth the column (divided by two, it becomes column 33.5, which means the letter is gonna be drawn on column 33 and column 34), and it create a blur.

So what are the solutions?

  • Find a better algorithm
  • Apply a "sharpening filter" after resizing to reduce the blur (I've been thinking about it, but didn't find the time to work on it yet)
  • Have assets with no straight lines, or lines that are divisible by 2

For the second problem, the fact that the xxxhdpi output is bigger than the input: I'm aware of it, it can happen sometimes. It's because in the output folder, I reencode the output. It shouldn't be done, and I will fix it in the next release.

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

I'm working on a "sharpen" feature currently. It will be optional, because wether it makes the results better or not is subjective.

from 9-patch-resizer.

noam2 avatar noam2 commented on August 17, 2024

all images are blurry, is anything you can do?

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

@noam2 Please provide some sample images.

from 9-patch-resizer.

noam2 avatar noam2 commented on August 17, 2024

can you give me your email and ill show you

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

@noam2 Same username, at gmail

from 9-patch-resizer.

noam2 avatar noam2 commented on August 17, 2024

[email protected] ? sent you , you didnt reply

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

@noam2 Sorry, went of grid for the weekend.
I looked at your image and... the original is a 94x116 mdpi image. And from that, you generate the other densities (hdpi, xhdpi, xxhdpi). Which makes your image bigger, and of course blurry.

For this tool to work for you, you need to have an original in xxhdpi. And it will create for you smaller pictures. If you create bigger pictures, like in photoshop, you get a blurred result.

Cheers

from 9-patch-resizer.

noam2 avatar noam2 commented on August 17, 2024

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

@noam2 "mdpi" should be the base of what you want as the smallest image. So if you want the mdpi image to be 100x100 pixel, you would create a high quality 300x300 xxhdpi image. (Remember that mdpi is x1, hdpi is x1.5, xhdpi is x2 and xxhdpi is x3)

I don't think that you need to care for ldpi anymore. Recent phones have usually a better screen density than that.

I would not advice to do a 100 images animation: it would probably use up too much memory.

from 9-patch-resizer.

noam2 avatar noam2 commented on August 17, 2024

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

@noam2 About densities, depends what kind of phones you target, and in what market I guess. In western countries, I think they are no useless, not sure about India or China.

For animation: yes, you would take care of every pictures

As for the densities calculation, that's basic android stuff :-) check https://developer.android.com/guide/practices/screens_support.html and read the part about "Alternative drawables"

I hope it helps!

from 9-patch-resizer.

noam2 avatar noam2 commented on August 17, 2024

from 9-patch-resizer.

redwarp avatar redwarp commented on August 17, 2024

Hey sorry, I don't think I can really provide more help than that. I would personally use mdpi, hdpi, xhdpi and xxhdpi. I'm not sure it's still appropriate though, maybe you should look for stats about screen density usage?

All the resources and where to put them are explained in the Android Developer tutorials (https://www.udacity.com/course/android-developer-nanodegree-by-google--nd801) it's free.

This is outside of the problem of this ticket, so I will comment on that no further.

Good luck with your app.

from 9-patch-resizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.