CPCWiki forum

General Category => General Discussion - Introductions => Topic started by: Dec on 02:02, 18 January 21

Title: DaDither - new image converter
Post by: Dec on 02:02, 18 January 21
I want to introduce my image converter for Windows - DaDither. It can convert bmp/png/gif/jpeg into

- SCR+PAL files. Modes 0, 1 and 2 are supported. Loaded images can be "executed" with CALL &C7D0.
- PPH+EVE+ODD files (B0 format).
- HGB file (FutureOS wallpaper).
(https://www.dadither.com/img/AmstradCPC1.png)
Download link (https://www.dadither.com/bin/DaDither.exe).
Title: Re: DaDither - new image converter
Post by: Gryzor on 10:01, 18 January 21
Really nice! I've seen a few mobile apps that offer different profiles but first time I see it for Windows. Works very nicely, though sometimes it fails, giving either a black output or the original image as output.

Thanks!!
Title: Re: DaDither - new image converter
Post by: Dec on 10:09, 18 January 21
Quote from: Gryzor on 10:01, 18 January 21sometimes it fails, giving either a black output or the original image as output.
After several months of tool history you are the first who tell me about the problem. Can the problem be reproduced?
Title: Re: DaDither - new image converter
Post by: Gryzor on 10:39, 18 January 21

Haha let me check...


Apparently, yes. I used the attached. In CPC mode, mode 1/color I only get black; grey and B&W work ok. Same (black only) happens with Sam/Screen 3.


IBM VGA 320x200x8 returns the original (never have 8 colours looked better! :D )



Title: Re: DaDither - new image converter
Post by: Dec on 10:50, 18 January 21
Quote from: Gryzor on 10:39, 18 January 21In CPC mode, mode 1/color I only get black; grey and B&W work ok. Same (black only) happens with Sam/Screen 3.
It is not a bug. It is a specific. ) The image is very dark by itself so the program cannot build correct palette. I will think about how to fix it.

Quote from: Gryzor on 10:39, 18 January 21IBM VGA 320x200x8 returns the original (never have 8 colours looked better! :D )
The program creates image that looks like original but not original. Original image has 1121 colors, converted image has 254 only.
320x200x8 means 8 bits per sample.
Title: Re: DaDither - new image converter
Post by: Gryzor on 11:18, 18 January 21

Quote from: Dec on 10:50, 18 January 21
It is not a bug. It is a specific. ) The image is very dark by itself so the program cannot build correct palette. I will think about how to fix it.


Ah, I'd think that color would fair at least as good as B&W or grey, but I see your point

Quote from: Dec on 10:50, 18 January 21
The program creates image that looks like original but not original. Original image has 1121 colors, converted image has 254 only.
320x200x8 means 8 bits per sample.

:picard2:
Please don't hold it against me, coffee hadn't kicked in yet.
Title: Re: DaDither - new image converter
Post by: Sykobee (Briggsy) on 11:27, 18 January 21

Great! These tools are always useful.

Could you add a contrast adjustment? It might mean the palette/image doesn't match the original, but for an 8-bitter's limited palette you would often have to resort to this anyway when doing graphics. I.e., you want to get the darkest colour on the image (which may range from mid-dark grey to pale grey in brightness) to black, and the lightest brighter as well (perhaps to white if that makes sense).


Perhaps another image adjustment ('crush to target palette') might try to push similar colours towards one target palette colour, to reduce wide bands of dithering (as in the example image above) to flat colours, even if it's not a perfect match for the original image. Of course this might be pretty hard to implement...


Obviously hand touching up afterwards is the best option regardless.
Title: Re: DaDither - new image converter
Post by: Dec on 11:36, 18 January 21
Quote from: Sykobee (Briggsy) on 11:27, 18 January 21Could you add a contrast adjustment?
It is planned.

Quote from: Sykobee (Briggsy) on 11:27, 18 January 21push similar colours towards one target palette colour
How can I detect that 2 colors are similar? I need math formula.
Title: Re: DaDither - new image converter
Post by: Dec on 12:10, 18 January 21
Quote from: Sykobee (Briggsy) on 11:27, 18 January 21push similar colours towards one target palette colour
Also you can play with Error diffusion parameter.
Title: Re: DaDither - new image converter
Post by: XeNoMoRPH on 12:20, 18 January 21
one question from other guy, any chance to have the fullscreen mode included ?  :)
Title: Re: DaDither - new image converter
Post by: Dec on 12:29, 18 January 21
Quote from: XeNoMoRPH on 12:20, 18 January 21fullscreen
Do you mean overscan? Technically it is not a problem to add. The problem is how to save them. Is there any standard?
Title: Re: DaDither - new image converter
Post by: ComSoft6128 on 14:46, 18 January 21
Many thanks!


I plan on using this in the near future :)
Title: Re: DaDither - new image converter
Post by: Sykobee (Briggsy) on 16:08, 18 January 21
Quote from: Dec on 12:29, 18 January 21
Do you mean overscan? Technically it is not a problem to add. The problem is how to save them. Is there any standard?


There was a tool called CpcConvImg, and another from Devilmarkus called JavaCPC-Paint, that supported executable (i.e., RUN "file.scr") overscan images in .scr format - it would be nice (but not necessary) to be compatible with one or the other, although that might take some disassembly and analysis. And presumably clean up on exit.


http://www.cpcwiki.eu/forum/programming/overscan/ (http://www.cpcwiki.eu/forum/programming/overscan/) was a thread I found on that. Also http://www.cpcwiki.eu/forum/programming/how-load-overscan-image-and-program-in-basic-loader/ (http://www.cpcwiki.eu/forum/programming/how-load-overscan-image-and-program-in-basic-loader/)


I don't know if that helps.


Title: Re: DaDither - new image converter
Post by: GUNHED on 21:20, 18 January 21
Very nice! Would it be possible to have also the full screen picture format. In MODE 2 this would be 512*256, or MODE 1 is 256 * 256. In MODE 0 it would be 128 in X and 256 in Y.


It would be awesome to have such 16 KB fullscreen formats too.  :) :) :)
Title: Re: DaDither - new image converter
Post by: Dec on 23:51, 18 January 21
Quote from: GUNHED on 21:20, 18 January 21Would it be possible to have also the full screen picture format. In MODE 2 this would be 512*256, or MODE 1 is 256 * 256. In MODE 0 it would be 128 in X and 256 in Y.
Output file format specification?
Title: Re: DaDither - new image converter
Post by: XeNoMoRPH on 09:34, 19 January 21
It would be interesting to save a .SCR compatible with Convimg & IMPdraw, file format would be easy to implement and it will allow graphist to rework picture on CPCs.
Title: Re: DaDither - new image converter
Post by: Dec on 09:41, 19 January 21
Quote from: XeNoMoRPH on 09:34, 19 January 21It would be interesting to save a .SCR compatible with Convimg & IMPdraw
Are files created with current version of DaDither not compatible with Convimg & IMPdraw?
Title: Re: DaDither - new image converter
Post by: Sid_ on 13:12, 19 January 21
If you want a sample code to export Overscan screen check this link https://github.com/jeromelesaux/martine/blob/46f8c8b3f028077f29a8b6e0515724c3c827b055/export/file/ocp.go#L8405


Hope it will help you.
Title: Re: DaDither - new image converter
Post by: GUNHED on 14:42, 19 January 21
Quote from: Dec on 23:51, 18 January 21
Output file format specification?
Exactly 16 KB, on CPC &C000-&FFFF (inclusive). As file type you could use *.HGB for MODE 2 screens.
Title: Re: DaDither - new image converter
Post by: Dec on 02:13, 20 January 21
For everybody who want the program to create some new formats: you must understand that I am NOT Amstrad CPC user. All my knowledge about CPC are based on the wikipedia article. Those things that are completely clear to you are completely incomprehensible to me. So if you want some new format - give me a link to format specification but not short description only.
Title: Re: DaDither - new image converter
Post by: Sid_ on 12:37, 20 January 21
here  a description for impdraw format : http://impdraw.wikidot.com/le-format-impdraw-v2
Title: Re: DaDither - new image converter
Post by: Dec on 06:26, 02 February 21
Update: very first try to add B0 format (two screens in Mode 0):

(https://www.dadither.com/img/AmstradCPC2.png)

You can save such images into PPH+EVE+ODD files and view them with Perfect Pix.

A request to the owners of real machines: could you check how images look on your monitors?
Title: Re: DaDither - new image converter
Post by: eto on 09:29, 02 February 21
Quote from: Dec on 06:26, 02 February 21A request to the owners of real machines: could you check how images look on your monitors?

Do you have some example images you are interested in? I can check it on a Plus and a CPC 6128, hooked to a 15kHZ capable TFT and a GBS8200 with a normal TFT.
Title: Re: DaDither - new image converter
Post by: Dec on 09:47, 02 February 21
Quote from: eto on 09:29, 02 February 21Do you have some example images you are interested in?
You can convert any image you want with my tool and compare preview in the tool and image on your monitor. The tool allows you to select palette. There is no way to calculate exact values of mixed colors for TFT monitors so images will be different in any way because exact values depend on lots of parameters of monitor internal hardware and color settings. But which palette will be more accurate? Also what about flickering? Is flickering weak or intensive?
Title: Re: DaDither - new image converter
Post by: eto on 10:42, 02 February 21
That's why I asked for example images. Then we can compare the different setups based on the same sources.
Title: Re: DaDither - new image converter
Post by: trocoloco on 19:59, 02 February 21
Quote from: Dec on 06:26, 02 February 21uest to the owners of real machines: could you check how images look on your monitors?

Hi, I've been testing some images on my 6128 and a CRT TV - Samsung slimfit, for more details.

I have used 70% flickering and even tho you can later reduce the palette on Perfect Pix, for darker colours flickering is barely to noticeable, on the other side when it comes to mixing bright colours, specially when mixing yellow, orange and cyan it is very noticeable. It makes a good effect for neon effects and fires hehe.
But more than a problem of the conversion, I believe is by the contrast of the colours used , which surely can be improved when editing the image.

By the way, will you implement modes B1 and R also? It would be a nice feature.

All in all, every image worked great and it does a nice job IMO. Thanks for this nice program :)
Title: Re: DaDither - new image converter
Post by: Dec on 21:33, 02 February 21
Quote from: trocoloco on 19:59, 02 February 21I've been testing some images
What palette did you use? sRGB or RGB? Did you test Gray mode?

Quote from: trocoloco on 19:59, 02 February 21when it comes to mixing bright colours ... it is very noticeable
You can try to reduce flickering by reducing Max flickering parameter.

Quote from: trocoloco on 19:59, 02 February 21But more than a problem of the conversion, I believe is by the contrast of the colours used
Could you explain what do you mean?

Quote from: trocoloco on 19:59, 02 February 21will you implement modes B1 and R also?
B1 - no, I don`t see a way how to automatically convert images into this mode. R - I am studying it now.
Title: Re: DaDither - new image converter
Post by: trocoloco on 22:58, 02 February 21
Quote from: Dec on 21:33, 02 February 21What palette did you use? sRGB or RGB? Did you test Gray mode?
RGB palette is more accurate for CPC when converting images. Regarding the gray mode, I don't see the point of gray mode with regular CPC palette, but sure suits plus models.

Quote from: Dec on 21:33, 02 February 21But more than a problem of the conversion, I believe is by the contrast of the colours used
Could you explain what do you mean?

when mixing for example yellow and pink the blinking is more visible because difference of color values , than mixing red and brow for example.
Title: Re: DaDither - new image converter
Post by: Dec on 02:27, 03 February 21
trocoloco, could you also test 2 images from the attachment. I am interesting in flickering level of images.
Title: Re: DaDither - new image converter
Post by: Dec on 05:41, 03 February 21
Update: Mode 2 512x256x1 support added (HGB files)
Title: Re: DaDither - new image converter
Post by: ComSoft6128 on 07:33, 03 February 21
Hi @Dec (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4072) , thank you for creating such an excellent tool, I have a question which is for CPCWiki members.


I've saved a converted file (.scr) to my downloads folder - how do I get this into a .dsk file for loading into the VIDI Rom or Advanced Art Studio?
Title: Re: DaDither - new image converter
Post by: Dec on 08:11, 03 February 21
Quote from: ComSoft6128 on 07:33, 03 February 21how do I get this into a .dsk file
I used ManageDsk tool to create DSK disk images.
Title: Re: DaDither - new image converter
Post by: ComSoft6128 on 09:36, 03 February 21
Thanks @Dec (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4072)  :)

Original:

Title: Re: DaDither - new image converter
Post by: ComSoft6128 on 09:39, 03 February 21
CPC version:

https://www.youtube.com/watch?v=TvzrHkQW43k (https://www.youtube.com/watch?v=TvzrHkQW43k)


Please note that the VIDI Rom only and not the hardware unit was used in the making of the video.

Links:
https://www.cpcwiki.eu/index.php/VIDI_digitizer


https://cpcrulez.fr/hardware-digit-digitaliseur_vidi.htm?t=VQ==


Not emulated - original hardware and software.

Please note that  the aspect ratio for this YouTube video is 16:9 but the CPC monitor
has an aspect ratio of 4:3 so you may wish to adjust your viewing device accordingly.
Title: Re: DaDither - new image converter
Post by: trocoloco on 16:02, 03 February 21
Quote from: Dec on 02:27, 03 February 21
trocoloco, could you also test 2 images from the attachment. I am interesting in flickering level of images.


for Test full screen is white mixed with some other colour and Test2 the full screen goes mauve or so as it uses yellow and pink or fucsia. The screens doesn't seem to flicker much but as everything is the same colour there's no other colours to compare with.
Title: Re: DaDither - new image converter
Post by: ComSoft6128 on 16:29, 03 February 21
Converted file loaded into the Advanced Art Studio.

Original


Title: Re: DaDither - new image converter
Post by: ComSoft6128 on 16:30, 03 February 21
Mode 2 CPC file


https://www.youtube.com/watch?v=BRHYIvWrmpU (https://www.youtube.com/watch?v=BRHYIvWrmpU)



Not emulated - original hardware and software.


Please note that  the aspect ratio for this YouTube video is 16:9 but the CPC monitor
has an aspect ratio of 4:3 so you may wish to adjust your viewing device accordingly.

Title: Re: DaDither - new image converter
Post by: GUNHED on 16:57, 03 February 21
Quote from: Dec on 05:41, 03 February 21
Update: Mode 2 512x256x1 support added (HGB files)


Awesome! I will have a look at it right now.  :) :) :)
Title: Re: DaDither - new image converter
Post by: GUNHED on 23:48, 03 February 21
The *.HGB generator (512x256, monochrome) works like a charm! Thank you very much!!!  :) :) :)

However, you can leave the 128 bytes header away. The *.HBG files are only pure GFX data and this way they are exactly 16 KB in size.
One can cut the first 128 bytes off by hand with an hex editor of course too.
But it's just not needed to add the usual header in this case.


Thanks again, this is a great application.  :) :) :)
Title: Re: DaDither - new image converter
Post by: Dec on 00:54, 04 February 21
Quote from: GUNHED on 23:48, 03 February 21However, you can leave the 128 bytes header away.
Fixed. Now tool creates file without AMSDos header. But there is an option that allows user to add header if it is needed.
Title: Re: DaDither - new image converter
Post by: Dec on 01:38, 04 February 21
Quote from: trocoloco on 16:02, 03 February 21for Test full screen is white mixed with some other colour
White is mixed with black and resulting color must be gray.

Quote from: trocoloco on 16:02, 03 February 21The screens doesn't seem to flicker much.
So we have a screen with most dark and most bright mixed colors and there is weak flickering. The feeling of flickering depends on how pixel with different colors are arranged on the two screens. My tool tries to minimize flickering by keeping the total brightness of both screens at the same level. The tool has a preview mode for two changing screens (Menu\View\Show flickering image, non CRT monitors will show inaccurate colors) and I don't see flickering on my 60 Hz monitor at all. And in my opinion, if you see large flickering, the tool has incorrectly placed the pixels on the screens, and this is due to the fact that the colors in used palette do not correspond to the real colors on your monitor.

So the main question is What are the correct RGB values for the Amstrad CPC palette. I really don`t understand why in all articles about Amstrad CPC palette it is recommended to use 127/128 for gray. Because real middle between black and whlite is 188.
Title: Re: DaDither - new image converter
Post by: trocoloco on 10:16, 04 February 21
Quote from: Dec on 01:38, 04 February 21White is mixed with black and resulting color must be gray.
is gray-ish- , certaninly it looks more white than black, not a 50/50 mix but will check and change a bit contrast and bright on the TV and see how this goes.

Quote from: Dec on 01:38, 04 February 21My tool tries to minimize flickering by keeping the total brightness of both screens at the same level. The tool has a preview mode for two changing screens (Menu\View\Show flickering image, non CRT monitors will show inaccurate colors) and I don't see flickering on my 60 Hz monitor at all. And in my opinion, if you see large flickering, the tool has incorrectly placed the pixels on the screens, and this is due to the fact that the colors in used palette do not correspond to the real colors on your monitor.

Remember that CPC refreshes at 50hz not 60 so effect won't be seen the same way. Using the Show flickering option, I have noticed (at least in my 60hz monitor) that noticeable flickering occurs between around 35 and 85 , at 100% flickering is gone. So, what i will try is a couple of picture in various in from 0 to 10 in 10% increments and see how it responds.

for reference I will use these pictures


(https://ibb.co/7VvZHQChttps://ibb.co/7VvZHQC)(https://ibb.co/F49H570)
Title: Re: DaDither - new image converter
Post by: Sykobee (Briggsy) on 10:30, 04 February 21

(I was responding to a comment that seems to have been deleted)

The gate array RGB voltages probably don't correspond to how the CPC monitor displays the eventual colour as there's likely some curve (so it's certainly possible that grey would be closer to 70% than exactly 50% grey). Also there might be variance between ASIC versions.


The best solution would be to properly record the on-screen colours using a screen calibration tool into some known colour space (sRGB, etc) so they can be used in tools like this, and emulators.


Also it's possible that the first CPC emulators, which picked 127, were displayed on CRT monitors themselves, so this worked fine and was fairly accurate.
Title: Re: DaDither - new image converter
Post by: Dec on 11:06, 04 February 21
Quote from: trocoloco on 10:16, 04 February 21I have noticed (at least in my 60hz monitor) that noticeable flickering occurs between around 35 and 85
There was a serious error in my algo. Thanks to your notice I fixed it. Thanks! Please update the program.
Title: Re: DaDither - new image converter
Post by: Dec on 11:19, 04 February 21
Quote from: Sykobee (Briggsy) on 10:30, 04 February 21The gate array RGB voltages probably don't correspond to how the CPC monitor displays the eventual colour as there's likely some curve
So we need a specialist who understands how CRT monitor works inside.

Quote from: Sykobee (Briggsy) on 10:30, 04 February 21The best solution would be to properly record the on-screen colours using a screen calibration tool into some known colour space (sRGB, etc) so they can be used in tools like this, and emulators.
Fully agree.
Title: Re: DaDither - new image converter
Post by: Dec on 11:31, 04 February 21
And my error again  :doh: Actual version is 1.36.
Title: Re: DaDither - new image converter
Post by: GUNHED on 16:43, 04 February 21
Windows 7, 64 bit: Started DaDither, loaded flor.jpg (see before). Program suddenly ended.
Tried again, works well, including saving picture.


The headerless feature works perfect for .HGB wallpapers - Thank you very much!



Title: Re: DaDither - new image converter
Post by: trocoloco on 22:09, 04 February 21
Hi @Dec (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4072) , i have been testing the flower pic in various degrees of flickering tolerance and obviously 0% didn't flicker as it was 16 cpc colours, then as percentage increases so does the flickering. As said more in bright colurs, first it was the lower band of petals where the fucsia and blues are mixed and then from 60% 70% onwardsthe flickering increases yellow and white colours but.

All in all the flickering is less noticeable and unpleasant to the eyes,  is the normal flicker effect that it is expected with this type of technique. IMO it has improved over the previous test. I have to say that i used RGB palette, I will do more tests using sRGB instead.

Before i had to suffer to create screens in such format but thanks to you, now is piece of cake!
Title: Re: DaDither - new image converter
Post by: Dec on 18:11, 08 February 21
Quote from: trocoloco on 22:09, 04 February 21All in all the flickering is less noticeable and unpleasant to the eyes

I have found another one bug in my anti flickering algo. Could you check updated version?

Updated version also has limited B1 support.
Title: Re: DaDither - new image converter
Post by: trocoloco on 20:52, 08 February 21
Quote from: Dec on 18:11, 08 February 21
I have found another one bug in my anti flickering algo. Could you check updated version?

Updated version also has limited B1 support.

Hi! yes no problem, I will run some tests and let you know tomorrow what I've found out  :)
Title: Re: DaDither - new image converter
Post by: trocoloco on 19:21, 09 February 21
Quote from: trocoloco on 20:52, 08 February 21Updated version also has limited B1 support.
Hi Dec, as promised I've been running some tests using both images in modes B0 and the newly implemented B1 and it works great btw.
In this version the flickering levels are clearly reduced even when it changes from 30 to 80 por example, it is still there of course but it is definitely more pleasant to the eye. 

As the previous tests, reds and yellows are the most noticeable ones but even so the flickering is reduced by a good margin, it doesn't do that fire effect anymore. I have tried on a TFT TV as well and some screens just dont even flicker at all, that's amazing. Also I have to mention that when using sRGB the images created look darker than using RGB which in my opinion suits better the CPC and even more for the B1 mode.

So in conclusion, to me at least, there are clear improvements over previous versions. I hope more people could help give you a hand  and leave their impressions, specially pixel artists, that obviously have a trained eye hehe.

I hope this helped :)



Title: Re: DaDither - new image converter
Post by: Dec on 19:37, 09 February 21
Quote from: trocoloco on 19:21, 09 February 21I hope this helped
Yes, thanks for your feedback.
Title: Re: DaDither - new image converter
Post by: Dec on 00:45, 18 February 21
Update: overscan images support added. Images can be shown with RUN "Name.scr" command.

I took boot bytes from martine (https://github.com/jeromelesaux/martine) code. Boot section contains string "iMP v2" and it looks like images will be compatible with Impdraw but this needs to be checked.
Title: Re: DaDither - new image converter
Post by: dimdim80 on 00:53, 27 December 21
After i do the batch convert how can i use it on my basic program?
Powered by SMFPacks Menu Editor Mod