|
Forum Index : Microcontroller and PC projects : Ravenloft game picomite VGA - help needed
| Author | Message | ||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
Hi everyone ! Here’s a small video of the game I mentioned in my previous post. Ravenloft youtube preview When I see the quality of other games, I don’t even dare share the code for the current state of mine. I’m currently refining the code I wrote with Mistral AI (go France!) and ChatGPT to build a proper game engine. i'm a total beginner and made absolute spaghetti code. I’m not posting this to show off the current state of the game, but because I have a problem. I used to use a software on Windows (I think, though I also use Linux a lot) that could convert BMP files into images like the ones I was producing at the beginning of the game. However, I lost my development machine along the way and can’t remember the name of that software... Before : ![]() After : ![]() The BMP files I created with AI and then processed in GIMP don’t look anything alike the one I did with the previous software... I really liked that "dot" effect. Do you know which software did that, or what filter/post-processing I should use in GIMP to get the same result? Thank you guys ! Bon dimanche from la France |
||||
| Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 691 |
Your second image is not attempting to do any dithering, whereas the first image is. So I think you need the original picture in colour or shades of grey, then use a program to convert it to a 2 colour image, black and white, but using dithering to reproduce the shades of grey. Have a look at this thread these were dithering for colour images, but as I said, just specify only a 2 colour image as output. Edited 2025-11-23 23:02 by Bleep |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
Thanks a lot ! Gimp must be able to do that i'm trying right now |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1311 |
The Picomite VGA does not have a color for gray, but it is still possible to dither and display grayscale images reasonably well.So it's all about mixing colors ![]() On the left is the original image, on the right is the image prepared for the Pico. The conversion program runs in MMBasic for Windows.: FN$="Grayscale" '--------------------------------- ' Atkinson Dithering v 0.94 - Korrigierte Randbehandlung ' Converts PNG Source Files to RGB121 BMP ' by Martin H. 2025 (with the help of the AI assistant) '--------------------------------- Mode 1 ' Read PNG header to determine image size dim integer w, h open FN$ + ".png" for input as #1 s$ = INPUT$(24, #1) ' Read width w=ASC(MID$(s$,17,1))*16777216 inc w,(ASC(MID$(s$,18,1))*65536) inc w,(ASC(MID$(s$,19,1))*256) inc w,ASC(MID$(s$,20,1)) ' Read height h=ASC(MID$(s$,21,1))*16777216 inc h,(ASC(MID$(s$,22,1))*65536) inc h,(ASC(MID$(s$,23,1))*256) inc h,ASC(MID$(s$,24,1)) close #1 dim integer BL%=(h*w)/64 Dim integer listR(BL%),listG(BL%),listB(BL%) cls ' Load source image load png FN$+".png" ' Atkinson ring buffer (starts at index 0, goes up to W+3 for safety) Dim integer RLine(W+3,3),BLine(W+3,3),GLine(W+3,3) ' *************************************************************** ' START SCAN ' *************************************************************** for Ypos=0 to H-1 for Xpos=0 to W-1 n=Pixel(Xpos,Ypos)AND &HFFFFFF R=(N AND 255):G=((N >> 8)AND 255):B=((N >> 16) AND 255) ' ----------------------------------------------------------------- ' 1.GREEN (2 bits: 0, 85, 170, 255) ' ----------------------------------------------------------------- GV = G + GLine(Xpos, 1) ' Clipping (Zwischenwert) if GV > 255 then GV = 255 if GV < 0 then GV = 0 ' Quantization to 4 values (step size 85) Index = INT(GV / 85 + 0.5) ' Palettenwert berechnen CG = Index * 85 ' Since the index is at most 3 (3*85 = 255), no additional clipping is necessary, ' but for robustness we leave it in: if CG > 255 then CG = 255 GE = GV - CG ' Error is calculated from GV (intermediate value) - CG (pallet value) GE = GV - CG ' Fehler wird aus GV (Zwischenwert) - CG (Palettenwert) berechnet ' 2. RED (1 bit: 0 or 255) ' ----------------------------------------------------------------- RV=R+RLine(Xpos,1) CR=0 if RV>128 then RE=RV-255:CR=255 ' Error is negative, palette value is 255 else RE=RV:CR=0 ' Error is positive, pallet value is 0 end if ' ----------------------------------------------------------------- ' 3. BLUE (1 bit: 0 or 255) ' ----------------------------------------------------------------- BV=B+BLine(Xpos,1) CB=0 if BV>128 then BE=BV-255:CB=255 else BE=BV:CB=0 end if 'Plot output pixel Pixel Xpos,Ypos+h,RGB(CR,CG,CB) ' Prepare errors for distribution (1/8 share for all channels) RE_EIGHT = RE/8 BE_EIGHT = BE/8 GE_EIGHT = GE/8 ' ***************************************************************** ' ERROR DISTRIBUTION (Atkinson 1/8 kernel) ' ***************************************************************** ' 1. CURRENT LINE (Y) / RLine(F,1) if Xpos < W-1 then ' (X+1, Y) inc GLine(Xpos+1,1),GE_EIGHT:inc BLine(Xpos+1,1),BE_EIGHT:inc RLine(Xpos+1,1),RE_EIGHT end if if Xpos < W-2 then ' (X+2, Y) inc GLine(Xpos+2,1),GE_EIGHT:inc BLine(Xpos+2,1),BE_EIGHT:inc RLine(Xpos+2,1),RE_EIGHT end if ' 2. NEXT LINE (Y+1) / RLine(F,2) if Ypos < H-1 then ' Only distribute if there is a next line if Xpos > 0 then ' (X-1, Y+1) - Randprüfung für Index 0 inc GLine(Xpos-1,2),GE_EIGHT:inc BLine(Xpos-1,2),BE_EIGHT:inc RLine(Xpos-1,2),RE_EIGHT end if ' (X, Y+1) inc GLine(Xpos,2),GE_EIGHT:inc BLine(Xpos,2),BE_EIGHT:inc RLine(Xpos,2),RE_EIGHT if Xpos < W-1 then ' (X+1, Y+1) inc GLine(Xpos+1,2),GE_EIGHT:inc BLine(Xpos+1,2),BE_EIGHT:inc RLine(Xpos+1,2),RE_EIGHT end if ' 3. NEXT LINE (Y+2) / RLine(F,3) if Ypos < H-2 then ' Only distribute if there is a line after the next one ' (X, Y+2) inc GLine(Xpos,3),GE_EIGHT:inc BLine(Xpos,3),BE_EIGHT:inc RLine(Xpos,3),RE_EIGHT end if end if Next ' Next line, scrolling the ring buffer for f=0 to W+3 RLine(F,1)=RLine(F,2):RLine(F,2)=RLine(F,3):RLine(F,3)=0 BLine(F,1)=BLine(F,2):BLine(F,2)=BLine(F,3):BLine(F,3)=0 GLine(F,1)=GLine(F,2):GLine(F,2)=GLine(F,3):GLine(F,3)=0 Next Next save image FN$+".bmp",0,h,w,h if you want it Mode 1 (B/W) maybe you try https://ditherit.com/ upload your Grayscale Picture, remove all Graytones exept Black and White, then let it dither it for you ![]() Have Fun Cheers Martin Edited 2025-11-24 00:40 by Martin H. 'no comment |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
Thanks a lot, I was playing with Gimp with no success, i'm trying this. I'm trying to do a very small game (10/15 min gameplay for a short story with 2/3 endings) and i'd like all the picture to kind of look "the same" even if I made them with AI. EDIT : i did read the thread mentionned by bleep but the lazy me was wishing to have a simple GUI in gimp to help me do that... Anyway thanks ! Edited 2025-11-24 00:35 by JulesO |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1311 |
then if you want it Mode 1 (B/W) maybe you try https://ditherit.com/ upload your Grayscale Picture, remove all Graytones from the color Palette (exept Black and White), then let it dither it for you ![]() Edited 2025-11-24 00:46 by Martin H. 'no comment |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
Martin this is it ! I used to ask AI to make me a jpeg. Then i was greyscalling it using gimp and used my software to do the dithering. This website is exactly what I was looking for. Again thanks a lot to you and this amazing community, i'm back to work ! Hope to see you soon with good news and some code to share ! |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1311 |
I'm curious to see how it goes. And don't let the fact that you're a beginner in MMBasic put you off. After all, we all were at some point. Here, you'll usually find someone who will help you without being arrogant. Good luck and have a nice rest of your Sunday. Cheers Martin 'no comment |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
![]() Thank you for the encouragement! What a wonderful time to learn things. |
||||
| AlbertR Regular Member Joined: 29/05/2025 Location: GermanyPosts: 84 |
Hi Jules, it's great to see how many solutions there are. Thanks a lot, I was playing with Gimp with no success, i'm trying this. I think I need to defend GIMP's honor here. With procedure ![]() ![]() you got thomething like this ![]() Regards Albert |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
I think I need to defend GIMP's honor here. Regards Albert I was sure it was possible... Gimp always amaze me but like linux you got to understand it before. Thanks a lot, AGAIN ! EDIT : it look very nice, there's some job to do with contrast ![]() It's really good ![]() EDIT EDIT : with indexed colors as you shown ![]() It's really nice Edited 2025-11-24 02:36 by JulesO |
||||
| thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4328 |
It's looking really nice @JulesO, and if you need help there will be someone here to help you ... even me, though possibly only if you are desperate and a big fan of over-engineered solutions .I'm really pleased to see more MMBasic programs (and yes to me that largely means games) in the pipeline rather than endless firmware enhancements from Peter & Claude ... which are a means to an end rather than an end in themselves. Best wishes and good luck, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
.I'm really pleased to see more MMBasic programs (and yes to me that largely means games) in the pipeline rather than endless firmware enhancements from Peter & Claude ... which are a means to an end rather than an end in themselves. Best wishes and good luck, Tom I'm very honored thank you. This is part of my plan: to optimize my game by reinventing the wheel, learn as much code as possible, and present all of you with a beta that at least holds its own so "we" can make it better. |
||||
| joker Newbie Joined: 06/02/2024 Location: GermanyPosts: 32 |
The BMP files I created with AI and then processed in GIMP don’t look anything alike the one I did with the previous software... I really liked that "dot" effect. Do you know which software did that, or what filter/post-processing I should use in GIMP to get the same result? Hi Jules, You can do it with Gimp. 1. Load your color image and scale it to the desired size 2. Change the mode of the picture to "Indexed" 3. Select "optimzed palette" wit 2 colors only 4. Activate Floyd-Steinberg dithering, "Dithering for transparency" could be helpful as well. The result will look like this: ![]() Have fun Matthias |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5484 |
https://www.youtube.com/shorts/FicNIPlt3Po Volhout PicomiteVGA PETSCII ROBOTS |
||||
| JulesO Newbie Joined: 08/09/2025 Location: FrancePosts: 15 |
thanks everyone. As said by @AlbertR one got to choose reduceed color bleeding to achieve better color result. In french in case a fellow is here : ![]() Edited 2025-11-24 03:54 by JulesO |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |