nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
181 stars 14 forks source link

Convert image to PETSCII #92

Open Esshahn opened 6 years ago

Esshahn commented 6 years ago

(it had to come.... :D )

If I understood correctly, your rotation concept already uses this pattern matching, right? I'm not sure how to identify which background color to use though.

nurpax commented 5 years ago

I have many needs for this feature so rather than write this into some private python script for my own use, figured might as well stick this into Petmate. So moving to 0.5 milestone.

Esshahn commented 5 years ago

yay \o/

nurpax commented 5 years ago

Mostly done but this still needs:

Esshahn commented 5 years ago

So I've tried it with the beta 0.5 without any luck. For my better understanding: could it be that the importer only works on PNGs that are already petscii? Because whatever 320x200 PNG I threw at it, I always got the red colored error message.

This is what I did expect:

Like this

screenshot 2019-01-03 um 13 23 46

digithree commented 5 years ago

Is there any idea for how to proceed with this? I have started looking at a possible implementation of a more tolerant import tool but I don't want to double up on work.

nurpax commented 5 years ago

Will probably still take a while for this to materialize in Petmate. Been a bit too busy at work and haven’t worked on my hobby projects much.

I have an idea for a UI that’d allow setting the right crop and scale for the input to guide the conversion process. I don’t have a good robust algorithm in mind for a fully automated converter. I think it’s possible but I’d prefer a human guides converter over a fully automated thing that sometimes fails.

If you have some ideas for doing this well, please share. :)

nurpax commented 5 years ago

Oh btw my comment was re: converting a screenshot of PETSCII to an exact PETSCII screencodes and colors. The algo that @Esshahn talks about is different. I do have a reasonably good converter for this written in Python/numpy and it’s not difficult in JS either. But needs the UI which takes more work. Not rocket science but anything I do that involves any CSS layout takes me a lot of time.

earthbound19 commented 4 years ago

@nurpax this isn't directly relevant to this issue, but I'm curious: what converter do you have written in Python, and is the code online, and if so, where?

nurpax commented 4 years ago

@earthbound19 Hi! I never released it publicly. I don't know if it's really all that good tho. :)

earthbound19 commented 4 years ago

Ok.

I'm now imagining a more general-purpose converter (which I might like to develop) that can reduce any image to any visually matching arbitrary set of glyphs (e.g. from any font), and any set of colors. That could cover commodore and a whole host of other older and modern computers.