Aye, and the girl's not bad either!
I think this is another instance when that Sparkie fella start's worring!

Seriously; some excellent work here netty. Great stuff.
******************srod wrote:On PB 4.3, ArraySize() is a native function.
Interested to see how you fixed that part!netmaestro wrote:-Fixed a bug where some images were being rendered upside down
http://en.wikipedia.org/wiki/Floyd-Steinberg_ditheringnetmaestro wrote:Yes, the trick is to get the DIBits in the same format that you're going to set them. I was taking a shortcut and just feeding SetDIBits the pointer from the object but I see now that you can't do that. The quality difference between this and the professional programs seems to be in the lack of dithering. I have no idea how to do dithering but I'll research it and give it a go. Any thoughts or suggestions on approach would be most appreciated.
Code: Select all
j = hImage
OpenWindow(1,WindowWidth(0)+24,0,ImageWidth(j),ImageHeight(j),"")
ImageGadget(1,0,0,0,0,ImageID(j))
Cool Code, thanksBlue wrote: BTW:
to better compare the original picture with the modified one, i added 3 lines to your example code, just before the Events loop:Code: Select all
j = hImage OpenWindow(1,WindowWidth(0)+24,0,ImageWidth(j),ImageHeight(j),"") ImageGadget(1,0,0,0,0,ImageID(j))
Code: Select all
#Eight_BlackWhite=0
#Eight_StandardPalette=1
#Eight_AdaptivePalette=2
hImage = LoadImage(#PB_Any, "girl.jpg")
i = ImageTo8bit(hImage, #Eight_AdaptivePalette,0)