Hardware accelerated polygon fill using LMMM

Page 2/3
1 | | 3

By Wlcracks

Hero (566)

Wlcracks's picture

18-03-2023, 07:48

Looks like the kitchen of Maniac Mansion NES.

By ARTRAG

Enlighted (6935)

ARTRAG's picture

18-03-2023, 08:34

Very good! Now you have to find a way to encode as lines and dots the result. In this way the idea can become a compression method.

By pizzapower

Master (171)

pizzapower's picture

18-03-2023, 14:03

Wlcracks wrote:

Looks like the kitchen of Maniac Mansion NES.

I think it's actually from the enhanced MSDOS version of Maniac Mansion. I had it laying around in my downloads folder for a while, so I am not sure.

By ARTRAG

Enlighted (6935)

ARTRAG's picture

19-03-2023, 12:09

@pizzapower, you could try to do the xor also vertically between y and y+1.
The two steps, on the x and the y, can be combined.
The encoded image will result in single points.

By pizzapower

Master (171)

pizzapower's picture

20-03-2023, 21:37

ARTRAG wrote:

@pizzapower, you could try to do the xor also vertically between y and y+1.
The two steps, on the x and the y, can be combined.
The encoded image will result in single points.

Yes, in two separate COPY operations, otherwise the result is an unusable mess. I'll write some experiments later.

By NYYRIKKI

Enlighted (6067)

NYYRIKKI's picture

20-03-2023, 23:16

You don't really need any Python for this kind of stuff... I think MSX-BASIC is easier.

10 SCREEN 5
20 CIRCLE (128,106),60,8
30 PAINT (128,106),8
40 LINE (100,100)-(130,180),4,BF
50 A$=INPUT$(1)
60 COPY (1,0)-(255,211) TO (0,0),,XOR
70 COPY (0,1)-(255,211) TO (0,0),,XOR
80 A$=INPUT$(1)
90 COPY (0,211)-(255,1) TO (0,210),,XOR
100 COPY (255,0)-(1,211) TO (254,0),,XOR
110 A$=INPUT$(1)

By pizzapower

Master (171)

pizzapower's picture

20-03-2023, 23:28

NYYRIKKI wrote:

You don't really need any Python for this kind of stuff... I think MSX-BASIC is easier.
[/code]

True for now, but if I want next to detect lines and store them separately to create a proper compression technique, say using Hough transform and/or Convolution matrix, doing it in Python will make the work much easier with OpenCV.

By ARTRAG

Enlighted (6935)

ARTRAG's picture

21-03-2023, 07:42

Once you have done the xor both on x and y axis you should get mainly sparse points which you can encode scanning the image line by line, as (offset, color)

By pizzapower

Master (171)

pizzapower's picture

21-03-2023, 17:16

ARTRAG wrote:

Once you have done the xor both on x and y axis you should get mainly sparse points which you can encode scanning the image line by line, as (offset, color)

It's done. Here is the same image with both horizontal and vertical sweep.

By pizzapower

Master (171)

pizzapower's picture

21-03-2023, 19:40

Here is a quick breakdown: The only line that changes into points is the perfectly vertical or horizontal line. Lines with different angles tend to bleed because of the way the XOR sweep goes over them and the image becomes a bit messier. But it seems that the line detection algorithm is still useful.

Page 2/3
1 | | 3