Page 1 of 1

scrconv - SCR -> GIF/PNG/JPG converter

Posted: Wed Dec 27, 2023 7:46 pm
by mrcook
I spent a bit of time today updating my CLI program for converting SCR files to GIF, PNG, or JPG files.

The source code is available on github: https://github.com/mrcook/scrconv

Featues:

* PNG, JPG, and GIF output formats
* auto format output: PNG by default, or an animated GIF when a screen contains flashing colours
* with or without the border
* set a customer border colour
* scaled images: 320x240 (default), 640x480, 960x720, 1280x960
* experimental auto-border colour, based on colours in the image

This is a terminal program written in the Go language, so you'll need to have Go installed to be able to compile it. This though is very simple:

Code: Select all

go install github.com/mrcook/scrconv/cmd/scrconv@latest
I haven't tested it on Windows, but I see no reason why it shouldn't work. I guess you just need to use "go.exe install" instead.

Notes on the auto-border colour feature:

The detection is pretty simple: it just counts the total number of PAPER and INK colours and chooses the most common one. I experimented with 30 or so screens and the result is that most will still have a black border. Of those that don't these are the more interesting ones: Lords of Midnight, Carrier Command, Monty on the Run. The only one I tried that was not so great is Knight Lore.

I guess not many people will find a use for this but if you do, well, here it is!

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Wed Jan 10, 2024 8:27 am
by g0blinish
How to compile sources to win32 executable?

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Wed Jan 10, 2024 11:49 am
by lfaria
mrcook wrote: Wed Dec 27, 2023 7:46 pm Notes on the auto-border colour feature:

The detection is pretty simple: it just counts the total number of PAPER and INK colours and chooses the most common one. I experimented with 30 or so screens and the result is that most will still have a black border. Of those that don't these are the more interesting ones: Lords of Midnight, Carrier Command, Monty on the Run. The only one I tried that was not so great is Knight Lore.
Nice idea! :)
But why consider the whole screen for the counting and not only the border "squares" (first and last column and first and last row)?

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Sat Jan 13, 2024 8:13 pm
by mrcook
g0blinish wrote: Wed Jan 10, 2024 8:27 am How to compile sources to win32 executable?
On macos this command is used on the terminal:

Code: Select all

go build ./cmd/scrconv
My assumption is that it would be the same on Windows, but using go.exe. I don't however have a windows machine to test that.

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Sat Jan 13, 2024 8:15 pm
by mrcook
lfaria wrote: Wed Jan 10, 2024 11:49 am But why consider the whole screen for the counting and not only the border "squares" (first and last column and first and last row)?
Sorry lfaria but I don't understand the question.

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Sat Jan 13, 2024 9:23 pm
by ParadigmShifter
They mean only check the colours in a 1 character width (could add a tweak for wider I suppose) around the border (so row 0, 23 and columns 0, 31) and not the colours in the middle of the screen.

EDIT: Although a contrasting border is good too really so I don't think there's a best way to do it.

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Sat Jan 13, 2024 9:29 pm
by mrcook
ParadigmShifter wrote: Sat Jan 13, 2024 9:23 pm They mean only check the colours in a 1 character width (could add a tweak for wider I suppose) around the border (so row 0, 23 and columns 0, 31) and not the colours in the middle of the screen.

EDIT: Although a contrasting border is good too really so I don't think there's a best way to do it.
Ah right, gotcha. Certainly worth a look at!

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Tue Jan 16, 2024 2:31 pm
by g0blinish
mrcook wrote: Sat Jan 13, 2024 8:13 pm On macos this command is used on the terminal:

Code: Select all

go build ./cmd/scrconv
My assumption is that it would be the same on Windows, but using go.exe. I don't however have a windows machine to test that.
I've already figured it out. 2738716 bytes is too much

Re: scrconv - SCR -> GIF/PNG/JPG converter

Posted: Thu Jan 18, 2024 10:50 pm
by mrcook
g0blinish wrote: Tue Jan 16, 2024 2:31 pm I've already figured it out. 2738716 bytes is too much
My laptop hard drive has 549,755,813,888 bytes, so I don't care.