Skip to content

Conversation

@HiCamino
Copy link
Contributor

One last try, I hate to giveup so I moved code around in the thread and i use a fast blur from https://blog.ivank.net/fastest-gaussian-blur.html it seems better. 4k is pretty responsive and 8k is a little slow but the slider stays responsive. let me know if it is good enough

Fixes #92

…oved.

Render blur to temporary texture to prevent flickering.
Implemented 'fast_gaussian_blur' method from blog.ivank.net that uses three
box blurs to approximate Gaussian blur. This makes slider more performant.

Fixes HaikuArchives#92
Implemented faster gaussian blur
moved code into thread

Fixes HaikuArchives#92
@humdingerb
Copy link
Member

humdingerb commented Mar 11, 2025

The visual results seem to be quite bad. Take any image and slide the "Sharpness" slider between both extremes. Instead of blurred it gets blocky, and sharpening also introduces some blockiness. Moving the "Effect strength" slider introduces major artefacts.
I tried with relatively small images, as it appears to crash with really big ones...

Have you tested your changes?

@HiCamino
Copy link
Contributor Author

so the blockiness (to some extent) is expected because it uses the lower resolution preview that other parts of the app use for example if you use the twirl addon with a large image it gets blocky. but it should resolve the blockiness after a moment, it should not stay blocky. there shouldn't be any artefacts.

yes i did test with a small 800px image a medium 4000px image and a large 8000px image and the only problem i saw was it takes a moment for the 8000px one to resolve after you release the mouse button. but 4000px and smaller worked pretty well to me? i wouldnt purposely post a broken code review, i just thought it might still be too slow

@humdingerb
Copy link
Member

humdingerb commented Mar 12, 2025

Some images showing the blockiness and artefacts:

Sharpness slider min:
sharpness-0

Sharpness slider max:
sharpness-max

Sharpness at ~80%, moving he effect strength slider produces artifacts:
effect-strength

The crash when moving the sharpness slider a few times with a large image:
ArtPaint-17968-debug-12-03-2025-06-42-50.report.txt

All 100% reproducible here. Weird that it's working for you... I'm on Haiku Beta5, 64bit.

@HiCamino
Copy link
Contributor Author

HiCamino commented Mar 12, 2025

that file at 800 x 600 works perfectly fine for me:
0-sharpness
100-sharpness
100-strength

and I blew it up to 8000px and still works:
100-strength-8000px
full-blur-8000px

Another image at 4k, full blur and full sharpness:
full-blur-4000px
full-sharp-4000px

The 8k one takes a second or so to "settle" but the other ones work well. I will look at the crash but if the feature overall doesnt work then maybe its not worth fixing the crash :(

maybe beta5 is behaveing different than nightly?
haikuversion

@humdingerb
Copy link
Member

humdingerb commented Mar 13, 2025

I rebased from master, and checked out this PR 660 on top of it. I did a "build.sh clean all" to remove all old objects and built from scratch. I still see the issues described above.

Not sure how we should proceed here. Maybe we need to find a third person to break the tie... :)

ETA: I checked with a nightly, too.

@HiCamino
Copy link
Contributor Author

I think if you are the person who usually veriefies the changes then you are the final say. "it works on my machine" is the oldest excuse in software! this isue is very very minor so I probably spent way too much time already on it and there are many other issues I could try to fix instead. i think the risk of breakng is not worth haveing a live slider

btw i noticed gaussian blur addons slider also isn't live so maybe it is just a hard problem to solve. thanks for testing it and sorry for wasting time

1 similar comment
@HiCamino
Copy link
Contributor Author

I think if you are the person who usually veriefies the changes then you are the final say. "it works on my machine" is the oldest excuse in software! this isue is very very minor so I probably spent way too much time already on it and there are many other issues I could try to fix instead. i think the risk of breakng is not worth haveing a live slider

btw i noticed gaussian blur addons slider also isn't live so maybe it is just a hard problem to solve. thanks for testing it and sorry for wasting time

@humdingerb
Copy link
Member

No harm done. I didn't spend too much time on it, at least. :)
It's still weird that I see these issues while you're not. Anyway, I suggest to keep this PR open in case somebody stumbles on it and wants to give it a try.

@korli
Copy link
Contributor

korli commented Mar 18, 2025

maybe beta5 is behaveing different than nightly? haikuversion

Are you in a VM? if yes, how many cpus? i9-14900K is very powerful, that might also explain why it works "better".

@humdingerb
Copy link
Member

I assume @korli's question was to HiCamino, though I just want to point out that my issues are not with speed, but the artifacts, blockage and crash.

@HiCamino
Copy link
Contributor Author

Sorry i didn't see this question. I was using a virtualbox vm but my number of cpus is 1. I don't think there is a way to choose a different slower cpu in virtualbox unfortunatley.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Sharpness addon: make "Effect strength" live

3 participants