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

y4my4m-pixelizer #363

Open
wants to merge 1 commit into
base: extensions
Choose a base branch
from

Conversation

y4my4my4m
Copy link

Info

https://github.com/y4my4my4m/y4my4m-pixelizer

This is a very simple script that simply shrinks the image down using neareset neighbour by the set pixel amount, with the option to scale it back up. As well as the option to remove the background using the first top-left pixel's color.

Before:
image

After:
image

Checklist:

  • I have read the Readme.md
  • The description is written in English.
  • The index.json and extension_template.json have not been modified.
  • The entry is placed in the extensions directory with the .json file extension.

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

there's an existing old script that is not actively maintained (from what I can see) but as far as I can tell it's still works
if possible I would prefer to update the old extension current UI practices as opposed to add a new extension that does basically the same thing
see https://github.com/Leodotpy/sd-pixel

it does everything yours dose and more accept "remove the background using the first top-left pixel's color"

seriously, why the top left pixel if you really want to do make it configurable

@y4my4my4m
Copy link
Author

@w-e-w
sure, that's doable, should i make a fork of sd-pixel and push an updated version instead or..?
A few people have been complaining about not being able to set the palette colors nor the dithering/quantization in sd-pixel, i guess i could add that too.

Also, top-left pixel is a common thing in spritesheets with the pink background.
Making it customizable is not an issue though

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

ahhh

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

@w-e-w w-e-w closed this Aug 12, 2024
@w-e-w w-e-w reopened this Aug 12, 2024
@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

I was working on it
2024-08-12 22_22_44_112 chrome

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

any suggestions before I make a PR to https://github.com/Leodotpy/sd-pixel

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

for future reference your pixelart tag is not a valid tag defined in tags.json
that's why the test failed

https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions/pull/363/files#diff-b8ed784df217098e9d0d9600db267045d95000f04c30838a68bb9552027e8ba1R7

@y4my4my4m
Copy link
Author

  • background transparency with tolerance (customize which pixel to use?)
  • allow changing the dithering
  • custom quantization? (something like that i suppose?)
  • force a certain palette (i saw another script was made for that but cant find it right now)

one pixelscript to rule them all

Also, my bad about the tag, should have caught that.

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

Also, top-left pixel is a common thing in spritesheets with the pink background.
Making it customizable is not an issue though

spritesheets as in basically different animation steps of a pixel art object?

I suppose that's a game industry thing?

@y4my4my4m
Copy link
Author

@w-e-w yes exactly, these:
image

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

force a certain palette (i saw another script was made for that but cant find it right now)

this?
https://github.com/mrreplicart/sd-webui-pixelart

@y4my4my4m
Copy link
Author

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

spritesheets img

so different frames can have different sizes (width and hight), I guess there is some sort of configuration that needs to go with this image right
and because that is a config you can make sure that that pixel is not used for an actual object and ca be use as an transparency color?

@y4my4my4m
Copy link
Author

@w-e-w yeah exactly, as far as I understand it it's more of a legacy standard so that you do not to have to deal with the alpha channel

in the case of AI, a few models are trained on these kind of pixelart and produces a non-transparent image anyway, so reusing the "pink background" method makes sense

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 12, 2024

in the case of AI, a few models are trained on these kind of pixelart and produces a non-transparent image anyway, so reusing the "pink background" method makes sense


I feel like transparency could be a standalone extension as it might be useful in general

like there are lots of ways you might want to set transparency for example
if you use auto background remover extensions like rembg I think they're a couple of extensions that uses rembg
or like what you did to your top left corner or specific color with tolerance

also depends on what you need the output format can be different
obviously the modern stuff we likely would just use Alpha Channel
but maybe in some cases you would like to instead embed transparency color palette metadata (not sure what it's called) in the specific format if supported

@y4my4my4m
Copy link
Author

@w-e-w it's not a bad idea
the reason why i made this was simply for my particular pixel art making workflow and im doing everything using API calls so a simple call simplified everything

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 13, 2024

im doing everything using API calls so a simple call simplified everything

wait ... if I my code reading is correct we seem to have neglected support different extra modules in API
if we support this then this shouldn't be an issue in the first place....


I was testing with different modes of dithering
I'm not sure if I screwed up somewhere because it doesn't seem to make a lot of difference

@y4my4my4m
Copy link
Author

@w-e-w yes the extra dont work out of the box in the API, ive been hard coding the changes for my server lol

Post some code for the dithering/result i can check with you

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

Successfully merging this pull request may close these issues.

2 participants