Welcome, Guest. Please login or register.


Author Topic: Q&A (Read 8736 times)

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Q&A
« on: 2016.November.21. 08:29:17 »
The place of Questions & Answers

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #1 on: 2016.November.21. 14:40:32 »
There were a small addon on the Hungarian forum, the best programs which are using Entermice should get extra prize also.

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Q&A
« Reply #2 on: 2016.November.21. 15:17:06 »
Ok, the idea is good. Will see how it turns out in the end.

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #3 on: 2016.November.24. 11:30:37 »
do you know a way how to generate gradient black-white for 64 values?

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Q&A
« Reply #4 on: 2016.November.24. 12:31:51 »
I think it would be somewhat hard to do black-white gradient in 16c mode, as there aren't much of grays in the palette (and those that are arent' real grays anyway I think). However in 4c pixel or the 8x2 char mode you could use dithering for additional colors on the tv display.
Anyway you would need a lpt with a couple of blocks and each block would have a different palette and screen data address. So for 64 levels and 256 pixel high screen you would need 64 modeblocks each for 4 lines of display.
You would have to figure out the right colors for each block to get smooth transitions.
« Last Edit: 2016.November.24. 12:42:47 by ssr86 »

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #5 on: 2016.November.24. 14:05:33 »
It is possible to convert a gradient from a picture with epimgconv. For example, this gradient:
[ Guests cannot view attachments ]
converted with the following command:

epimgconv -mode 0 -size 8 64 -quality 9 -chromaerr 0.5 -color1 109 -dither 1 0.875 -scalemode 1 -nointerp 1 -outfmt 1 gradient.png gradient.pic

looks like this:
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]

To extract the colors from the converted picture, you need to skip the first 17 bytes, then use the values from positions 0x11, 0x13, 0x15 and so on, ignoring the 0x6D bytes:
[ Guests cannot view attachments ]

Another method is to convert to 256 colors (-mode 5) and use only one column of the output file. Some experimenting with the dither parameters and chromaerr may also give a better result.

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Q&A
« Reply #6 on: 2016.November.24. 19:04:59 »
I've tried playing with the image posted by Istvan and I got something like this (note that these aren't 64 levels...):
in 4-colors:
[ Guests cannot view attachments ]
in 16-colors (only 8 colors used):
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]
palette:
COLOR00=#38
COLOR01=#f8
COLOR02=#07
COLOR03=#c7
COLOR04=#3f
COLOR05=#c0
COLOR06=#00
COLOR07=#ff

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #7 on: 2016.November.28. 12:27:45 »
and again about gradient - please help with parameters:

epimgconv  -mode 15 -outfmt 0 -size 320 64 -quality 9 -chromaerr 0.5 -color1 109 -dither 1 0.875 -scalemode 1 -nointerp 1 plasmapalette2.jpg tt.com

got a message:
*** epimgconv error: invalid image size for output format


Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #8 on: 2016.November.28. 13:03:23 »
The -size parameter expects the width in characters, so you probably need to use -size 32 16 to keep the original size of the image. But if the goal is to generate a gradient as a single palette color per line, then the image should be rotated by 90 degrees first.
« Last Edit: 2016.November.28. 13:13:52 by IstvanV »

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #9 on: 2016.November.28. 13:10:18 »
I used -size and got same message.

A purpose is to generate gradient for 200 color.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #10 on: 2016.November.28. 13:37:03 »
16 colors:
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]
epimgconv -mode 2 -outfmt 0 -size 40 200 -quality 9 -chromaerr 0.5 -dither 4 0 -scalemode 1 -nointerp 0 plasmapalette2r.png tt_16.com

256 colors:
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]
epimgconv -mode 5 -outfmt 0 -size 40 200 -quality 9 -chromaerr 0.5 -dither 4 0 -scalemode 1 -nointerp 0 plasmapalette2r.png tt_256.com

256 colors with random dither:
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]
epimgconv -mode 5 -outfmt 0 -size 40 200 -quality 9 -chromaerr 0.5 -dither 5 0 -scalemode 1 -nointerp 0 plasmapalette2r.png tt_256r.com

[ Guests cannot view attachments ]

For a single color per line, use a column of the 256 color picture that looks good. In tt_256(r).com, the pixel data begins at 220h (310h memory address when loaded) and one line is 80 bytes. So, the first column is at file offsets 220h, 270h, 2c0h, and so on.
« Last Edit: 2016.November.28. 13:43:44 by IstvanV »

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #11 on: 2016.November.28. 14:38:12 »
Thank you!
what is offset of color values in file? Faster is cut from com.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #12 on: 2016.November.28. 14:53:02 »
Thank you!
what is offset of color values in file? Faster is cut from com.

In tt_16.com:
- palette of first line: 1C8h-1CFh
- palette of second line: 1D8h-1DFh
- palette of last (200th) line: 0E38h-0E3Fh
- pixel data of first line: 0E90h-0EDFh
- pixel data of last (200th) line: 4CC0h-4D0Fh

In tt_256(r).com:
- pixel data of first line: 220h-26Fh
- pixel data of last (200th) line: 4050-409Fh
- pixel at X (0 to 79), Y (0 to 199) position: Y * 50h + X + 220h

These are all file (not memory) offsets.

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #13 on: 2016.November.28. 15:08:24 »
I understand. I do not need all data, just color values for gradient.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #14 on: 2016.November.28. 15:17:14 »
I understand. I do not need all data, just color values for gradient.

You can use one column (every 80th byte) of tt_256.com for that purpose, choose whichever looks the best. For example, the first (leftmost) column is stored at offsets 220h, 270h, 2c0h, 310h, and so on.