scrconv - SCR -> GIF/PNG/JPG converter

Show us what you're working on, (preferably with screenshots).
Post Reply
mrcook
Drutt
Posts: 46
Joined: Tue Jun 09, 2020 7:31 pm

scrconv - SCR -> GIF/PNG/JPG converter

Post 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!
User avatar
g0blinish
Manic Miner
Posts: 287
Joined: Sun Jun 17, 2018 2:54 pm

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

Post by g0blinish »

How to compile sources to win32 executable?
lfaria
Dizzy
Posts: 85
Joined: Fri May 29, 2020 3:50 pm

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

Post 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)?
mrcook
Drutt
Posts: 46
Joined: Tue Jun 09, 2020 7:31 pm

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

Post 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.
mrcook
Drutt
Posts: 46
Joined: Tue Jun 09, 2020 7:31 pm

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

Post 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.
User avatar
ParadigmShifter
Manic Miner
Posts: 671
Joined: Sat Sep 09, 2023 4:55 am

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

Post 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.
mrcook
Drutt
Posts: 46
Joined: Tue Jun 09, 2020 7:31 pm

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

Post 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!
User avatar
g0blinish
Manic Miner
Posts: 287
Joined: Sun Jun 17, 2018 2:54 pm

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

Post 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
mrcook
Drutt
Posts: 46
Joined: Tue Jun 09, 2020 7:31 pm

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

Post 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.
Post Reply