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

Request: allow to auto-shrink #199

Closed
AndroidDeveloperLB opened this issue Mar 10, 2019 · 7 comments
Closed

Request: allow to auto-shrink #199

AndroidDeveloperLB opened this issue Mar 10, 2019 · 7 comments

Comments

@AndroidDeveloperLB
Copy link

Sometimes the input image already has duplicate pixels, and we wish to have it minimal, to adjust to the content.

Could be nice to have an auto-shrink button, to have the image minimized to what it could be.

@romannurik
Copy link
Owner

Sorry I never replied -- pretty sure this already exists in the tool..

@AndroidDeveloperLB
Copy link
Author

@romannurik In what tool? Can you please demonstrate (video) how it's done?
I never saw this behavior you say that exists, anywhere.

@romannurik
Copy link
Owner

I'm referring to the "Trim stretch region" button on the bottom:

Before:
before

After:
after

Were you referring to something else?

@romannurik
Copy link
Owner

Also if you do "Auto-stretch" it will try to optimize the corners... so Auto-stretch + Trim stretch region gives you something pretty minimal:

optimized

@AndroidDeveloperLB
Copy link
Author

You mean here:

https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#&sourceDensity=320&name=example

Doesn't seem like it works.
It seems to have multiple issues (Chromium based web browser):

  1. The preview shows the black markings.
  2. The dotted lines don't seem to match any markings. Not sure what they mean this way, and why they are positioned out of place.
  3. Using "Trim stretch region", it didn't the size of the marking size at all. Instead it seems that it moved it, and I think it reduced the size of the image in other places. The dotted lines still seem weird after using it, too.
  4. Choosing "auto stretch" (after "trim stretch region"), it doesn't seem to do anything except moving the dotted lines, and then they still seem out of place.
  5. There is no status bar (or anything similar) on this tool showing the size of the 9-patch (pure resolution of the PNG file), so I can't know for sure what's going on. I also can't see where the cursor is located in real time (to see where each pixel/marking went).
  6. And most importantly: Choosing to download (I wanted to see for myself in an editor what it did), it doesn't do anything.

Attached files of all the above, including the original 9-patch file that I tried to play with.

files.zip

@romannurik
Copy link
Owner

Oh it looks like you're uploading an existing nine-patch ... the tool isn't a nine-patch EDITOR so much as a GENERATOR... i.e. it won't let you edit an existing nine-patch, but if you just drop in something like this PNG, it'll generate the nine-patch markings for you after you resize the stretch regions and such.
Artboard

@AndroidDeveloperLB
Copy link
Author

@romannurik Are you saying it ignored the markings for some reason? After you generate something with it, you can't edit it again?
Why close the issue, then?

Can you please offer this tool on the IDE itself, too (including editing, and including auto-shrinking) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants