Author Topic: DaDither - new image converter  (Read 3707 times)

0 Members and 1 Guest are viewing this topic.

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
DaDither - new image converter
« on: 03: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).
Download link.
« Last Edit: 07:13, 06 February 21 by Dec »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.901
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4024
  • Likes Given: 7240
Re: DaDither - new image converter
« Reply #1 on: 11: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!!

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #2 on: 11:09, 18 January 21 »
sometimes 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?

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.901
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4024
  • Likes Given: 7240
Re: DaDither - new image converter
« Reply #3 on: 11: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 )




Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #4 on: 11:50, 18 January 21 »
In 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.

IBM 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.
« Last Edit: 11:52, 18 January 21 by Dec »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.901
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4024
  • Likes Given: 7240
Re: DaDither - new image converter
« Reply #5 on: 12:18, 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

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.

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 837
  • Country: gb
  • Liked: 314
  • Likes Given: 499
Re: DaDither - new image converter
« Reply #6 on: 12: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.
« Last Edit: 12:31, 18 January 21 by Sykobee (Briggsy) »

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #7 on: 12:36, 18 January 21 »
Could you add a contrast adjustment?
It is planned.

push similar colours towards one target palette colour
How can I detect that 2 colors are similar? I need math formula.

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #8 on: 13:10, 18 January 21 »
push similar colours towards one target palette colour
Also you can play with Error diffusion parameter.

Offline XeNoMoRPH

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.046
  • Country: es
  • " ... in space no one , can hear you scream ... "
    • https://auamstrad.es/
  • Liked: 2384
  • Likes Given: 1680
Re: DaDither - new image converter
« Reply #9 on: 13:20, 18 January 21 »
one question from other guy, any chance to have the fullscreen mode included ?  :)
your amstrad news source in spanish language : https://auamstrad.es

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #10 on: 13:29, 18 January 21 »
fullscreen
Do you mean overscan? Technically it is not a problem to add. The problem is how to save them. Is there any standard?

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.217
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 2417
  • Likes Given: 4672
Re: DaDither - new image converter
« Reply #11 on: 15:46, 18 January 21 »
Many thanks!


I plan on using this in the near future :)

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 837
  • Country: gb
  • Liked: 314
  • Likes Given: 499
Re: DaDither - new image converter
« Reply #12 on: 17:08, 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/ was a thread I found on that. Also http://www.cpcwiki.eu/forum/programming/how-load-overscan-image-and-program-in-basic-loader/


I don't know if that helps.



Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.688
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1261
  • Likes Given: 2958
Re: DaDither - new image converter
« Reply #13 on: 22: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.  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #14 on: 00:51, 19 January 21 »
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.
Output file format specification?

Offline XeNoMoRPH

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.046
  • Country: es
  • " ... in space no one , can hear you scream ... "
    • https://auamstrad.es/
  • Liked: 2384
  • Likes Given: 1680
Re: DaDither - new image converter
« Reply #15 on: 10: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.
your amstrad news source in spanish language : https://auamstrad.es

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #16 on: 10:41, 19 January 21 »
It would be interesting to save a .SCR compatible with Convimg & IMPdraw
Are files created with current version of DaDither not compatible with Convimg & IMPdraw?
« Last Edit: 10:42, 19 January 21 by Dec »

Offline Sid_

  • CPC664
  • ***
  • Posts: 122
  • Country: fr
  • Liked: 104
  • Likes Given: 315
Re: DaDither - new image converter
« Reply #17 on: 14: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.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.688
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1261
  • Likes Given: 2958
Re: DaDither - new image converter
« Reply #18 on: 15:42, 19 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.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #19 on: 03: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.

Offline Sid_

  • CPC664
  • ***
  • Posts: 122
  • Country: fr
  • Liked: 104
  • Likes Given: 315
Re: DaDither - new image converter
« Reply #20 on: 13:37, 20 January 21 »
here  a description for impdraw format : http://impdraw.wikidot.com/le-format-impdraw-v2

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #21 on: 07:26, 02 February 21 »
Update: very first try to add B0 format (two screens in Mode 0):


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?
« Last Edit: 07:18, 06 February 21 by Dec »

Online eto

  • Supporter
  • 464 Plus
  • *
  • Posts: 368
  • Country: de
  • Liked: 223
  • Likes Given: 220
Re: DaDither - new image converter
« Reply #22 on: 10:29, 02 February 21 »
A 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.

Offline Dec

  • CPC464
  • **
  • Posts: 23
  • Country: ru
  • Liked: 30
  • Likes Given: 4
Re: DaDither - new image converter
« Reply #23 on: 10:47, 02 February 21 »
Do 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?

Online eto

  • Supporter
  • 464 Plus
  • *
  • Posts: 368
  • Country: de
  • Liked: 223
  • Likes Given: 220
Re: DaDither - new image converter
« Reply #24 on: 11:42, 02 February 21 »
That's why I asked for example images. Then we can compare the different setups based on the same sources.