danbz/ofxDither

ofxDither sometimes trashes image

Closed this issue · 3 comments

copied from:
https://forum.openframeworks.cc/t/ofxdither-sometimes-trashes-image/37338

debug2.. png is the expected image, debug3 sometimes is corrupted.

https://github.com/Amalgam-Incorporated/goo/blob/main/src/ofApp.cpp#L110-L114

I have not been able to reproduce it consistently. I rerun my app with the same file, it's fine. The app loops, reading and poking a web server to delete/replace the input file. I have made it loop over the same file 50 times, and I hear someone else looped it 400 times, no problem.

What I have not tried is giving the app the sequence of inputs that resulted in an error. (because that's hard, but it is on the list of things to do.)

debug3_2021-02-27-20-51-03-267

danbz commented

thanks - looking at your code in the link - at line 112 you call ordered dither with the same image
'''
dither.dither_ordered(res, res, 8);
'''

as far as I understand you need to call this with the source image and specify an output image...

I made that change, and no more lines.
thanks for debugging my code ;)

danbz commented

thanks for letting me know it's working ok !
👍
D