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

Unwanted contour line #2

Closed
nightmaredream opened this issue Nov 29, 2019 · 14 comments
Closed

Unwanted contour line #2

nightmaredream opened this issue Nov 29, 2019 · 14 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@nightmaredream
Copy link

nightmaredream commented Nov 29, 2019

Hi, when i upscale any image, any mode, that has an alpha channel and transparency in it, it makes a contour line of glitched colors from pink to white and so on. I really need a solid line, and i'm batch doing files so i can't just go around and remove these contour lines one by one, it's a skull-scratching issue. Pixel art should Never have glitched contour lines, ever. I can't understand why this plugins isn't pre-fixed about that. IT'S obvious that upscaled sprites needs solid edges.

Batch-jobbing with Gimp is already a hassle (Using tinytask, doing eveything manually, automated, it's time-expensive)... Adding supplementary tasks such as "create layer mask, posterize mask, go filter, generic, erode, then saving, for every files with an alpha channel, consumes a lot of time... hence, your plugin should do solid edges.

@bbbbbr
Copy link
Owner

bbbbbr commented Nov 29, 2019

Hello,

I am not able to reproduce the issue so far.

Can you provide a couple details to help investigate this?

  • An example image for which the problem occurs
  • An example image (screenshot is fine) showing the undesired output
  • The version of GIMP and operating system you are using
  • Does this problem also occur for you in both batch and non-batch mode?

Thanks

@bbbbbr bbbbbr self-assigned this Nov 29, 2019
@bbbbbr bbbbbr added the bug Something isn't working label Nov 29, 2019
@nightmaredream
Copy link
Author

nightmaredream commented Nov 29, 2019

http:/www.nightmaredream.com/up/upscale%20example.zip

Thought i found a fix. When i say "batch" i mean, i used Tinytask to repeat actions. Because Gimp's batch is totally outdated and has almost no features at all in it. Or it's just overcomplicated and there's no simple way to build a task list i couldn't tell but it'S nothing user-friendly to say the least.

So the fix is that i go Layer > Transparency > threashold alpha.... That fixes the images, but only After they're created thought, which is a problem.

So... Soft edges aren't the biggest issues, but the fact pixel color of soft edges isn't the same color as the object is a problem... If anti aliasing was bleeding the same paint color as the rest of its surroundings, it would be much lesser a problem, thought, hard edges with same bleeding color as surroundings would be much better. I assume both options should be available. hard edges, colored soft edges

So yeah.... I had TinyTask to fix images one by one in gimp... saving as each files, confirming every png export prompts and so on... lmao...

Also suggestion: Do you think you could add a noise module that adds noise between rescaling stages? Say, if it was done in multiple stages. XNview's "pointillize" and "median box" are examples that might give some nice noise/denoise`

Oh, another tip for perfect upscaling: Try adding an imaginary margin all around image so border pixels doesn'T bleed strangely.

Even thought, if you make a "seamless" mode, it would be amazing, so that upscale becomes border-safe.

@nightmaredream
Copy link
Author

I'm usng HQ4x XBR and i still get bleeding edges.. I'll try pasting clipboard image :
image
algae

@bbbbbr
Copy link
Owner

bbbbbr commented Nov 29, 2019

Strange- should there be red aliasing in the image you posted? I don't see any.

pixel_scalers_plugin_alpha_issue_003

@nightmaredream
Copy link
Author

Oh... "Red" "bleedding"... Got it. By "bleeding" i mean, it's moist, it spreads around.

@nightmaredream
Copy link
Author

nightmaredream commented Nov 29, 2019

I'll try updating Gimp to latest

Nope... Already using latest version. 2.10.14

@bbbbbr
Copy link
Owner

bbbbbr commented Nov 29, 2019

To check if I understand - you do not want partial transparency on the edge pixels, just solid colors? (if source pixels had no transparency)

I think an option to suppress transparency could be added. I will look into it.

(There also appears to be behavior in GIMP where pressing delete on a selection will clear the alpha channel for that area but will not also clear the color for those pixels. This could lead to unwanted and unexpected edge anti-alias fringe colors, when one might expect to mix with just white or black.

Note to myself- to fix those colors without discarding the alpha channel requires converting the channel to a mask, editing the image, then reconverting the mask to an alpha channel.)

@nightmaredream
Copy link
Author

I need a solid edge, but i need choice too... But if i would chose aliassed edge, i would like it to be not of the color behind the transparent pixel because these are junk pixels, but of the color of the closest fully opaque pixel.

But yeah, for my cause, i need solid edges, and it has to reject colors coming from alpha 0<>250

@bbbbbr
Copy link
Owner

bbbbbr commented Dec 1, 2019

Here is a build to test which has two options:

  • Allow/Disallow semi-transparent pixels (edge aliasing, alpha < 255)
  • Suppress colors from alpha-hidden pixels (currently alpha <= 32)

The alpha thresholds are not yet configurable. They seem to work in many cases. Ability to change them may be done later.

plugin_pixel_art_scalers.zip

@nightmaredream
Copy link
Author

nightmaredream commented Dec 1, 2019

Hi, i have made tests, it's nearly perfect! It's much better. All it would need is a tolerance slider, then to disallow semi-transparent pixels and make tolerred pixels fully opaque.
I am testing with this file and it happens to have a few 99.7% opaque pixels. The images are from somebody else, my task is to upscale them for a skin pack and it's either fully opaque or fully transparent, semi transparent pixels causes the game to do visual glitches. It's for a game server with friends, tho when i'll make a final pack, it,ll only contain my files or no-pack-at-all. These as uploaded are for test purpose.

Sooo... Yeah, here's the actual file.
bromeliad

And the result file.
result

You'll notice that some parts of the green stomp are gone, linking the flowers to the grass.

You're almost at it!

--snip--

But yeah, for the moment, a tolerance slider... Then making every tolerated pixels fully opaque!

@nightmaredream

This comment has been minimized.

@bbbbbr
Copy link
Owner

bbbbbr commented Dec 1, 2019

I've opened a separate feature request ticket for your ideas about Seamless Tiling and Image Boundary handling since they are different topics. You can find them here:
#3

@bbbbbr
Copy link
Owner

bbbbbr commented Dec 1, 2019

Here is a build to try. There are now controls for adjusting the threshold of each alpha/opacity handling option.

Correct defaults values (254, 32) in the plug-in dialog may require a one-time restart of GIMP.

plugin_pixel_art_scalers.dec.01.001.zip

@bbbbbr
Copy link
Owner

bbbbbr commented Dec 3, 2019

Commits to implement feature + new binaries:
d397d75
82ff12e
1dbab1f
b96891d

@bbbbbr bbbbbr closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants