topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 25, 2018, 06:34 AM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Idea: decrease color depth of a picture to nearest text mode colors?  (Read 599 times)

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 143
    • View Profile
    • Donate to Member
Hello there .o/

Intro (to skip, go to the next bold text)
One of my colleagues has been working lately on making and documenting a procedure to automatically install an OS on a specific model of computer using SCCM.

While his process works fine, his documentation looks awful, mostly due to the quality of his pictures, which he made by taking photos of the screen with a phone while performing the procedure :(

I can easily take better quality pictures of most of the process by performing it in a virtual machine, however as far as I know, I can't have the VM's BIOS be identical to that of our real hardware (?)

I've already tried to decrease the color depth of his photos to 16 or 256 with IrfanView, with or without dithering, but the results always look pretty bad :/

Another option would be for me to re-type *everything* that appears on the screen and maybe add ANSI escape codes for color, but that would be very time consuming and could cause adding typos...

And this is why I would like … End of Intro
… a program that would take a picture, and decrease the color depth of each pixel to the nearest one that specifically exists in the palette that text mode DOS/Windows console can use (see color /? from the command line if needed).

I've seen that there is a program here: https://www.codeproj...520306/ASCII-Imaging which does something kind of similar, however from what I understand, there would be a few issues with trying to use that one for my needs:
- it would most likely try to replace every colored area with characters of its own choice
- it "works best" with 80 pixels wide pictures, which would obviously would make the pictures I want to "convert" unreadable, at 1 only pixel per character

Does someone know of such a program? Or does one of you want to give a try to making it?

KodeZwerg

  • Member
  • Joined in 2018
  • **
  • Posts: 170
    • View Profile
    • Donate to Member
Can you provide a "Before" and "After" Image to demonstrate what you are searching for?

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 143
    • View Profile
    • Donate to Member
Huh, OK… since I don't know how to properly manipulate a photo to obtain the result that I'd want (which is of course why I ask for an automated program to do so in my place), I suppose I'll provide photos of various text mode programs running in a virtual machine and also provide screenshots, as those would be as close as possible to the result I'd like, though of course I can't expect the output of the program to look nearly as sharp as the actual screenshots. Not sure how much help it will be, but I've attached an archive: the JPG files are photos while PNG ones are screenshots

Also, the actual photos I'd end up working with may have several of the following "features":
- lower resolution (maybe 1/4 or 1/5 that of mines)
- bad lighting
- rectangles may look even more like trapezes (I purposefully tilted the camera angle a bit sometimes to recreate the effect on the photos)
- a different aspect ratio
- moiré pattern

Again, I obviously don't except the result to be perfect, it should mostly be recognizable, preferably readable by a human, and lightweight.

KodeZwerg

  • Member
  • Joined in 2018
  • **
  • Posts: 170
    • View Profile
    • Donate to Member
Hello again,
from what i've read and by looking Sample Images, that is far beyond my limits.

The .png Files look perfect (i assume that they represent the "after")
The .jpg Files look not perfect (i assume that they represent the "before")

So you want a Tool that produce from your bad image a near perfect one with custom abilities.

Idk if such Graphic Monster like Photoshop can do all that automated, i doubt it but hey, its a large world.
At least this would be my first step, search for a good filter/script for PS.


For myself, i wish you good luck with that issue!

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 143
    • View Profile
    • Donate to Member
Hi again.

I suppose learning to use some image manipulation program would probably be the easiest solution to that problem.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,308
    • View Profile
    • Donate to Member
I thought converting to indexed colour might work but no joy:
Converted one of the samples to indexed colour with 8 colours in photoshop.
Didnt improve the image much, was still left with three tones in the grey area (b/w/grey).
If I replaced the white with grey (selecting it using 'magic wand' tool), the grey are looked better but the text then went very heavy and more difficult to read...

converted to 8 colours / indexed colour:

Screenshot - 2018-08-28 , 12_54_53_ver001.png
Tom

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 143
    • View Profile
    • Donate to Member
I might be able to work with something like that (except that I don't have Photoshop). If there's a way to replace the colour of "isolated" pixels (that is, those that don't have any of the same colour right next to them) with that of the ones surrounding it, it would certainly greatly improve the overall quality — even if the text isn't perfectly readable, it would probably look much less ugly with less pixel noise.

Anyway, there is no rush, as I realised that the procedure didn't require nearly as many screenshots considering the target audience, and could avoid using most of the worst ones.
« Last Edit: August 28, 2018, 08:50 AM by ConstanceJill »

KodeZwerg

  • Member
  • Joined in 2018
  • **
  • Posts: 170
    • View Profile
    • Donate to Member
I found something that could help you to correct angle and, if i read correct, let you specify output format.
Untested with your samples.
Heres the link.

Good luck!

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 143
    • View Profile
    • Donate to Member
Thanks, I'll give it a try :)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,308
    • View Profile
    • Donate to Member
I might be able to work with something like that (except that I don't have Photoshop). If there's a way to replace the colour of "isolated" pixels (that is, those that don't have any of the same colour right next to them) with that of the ones surrounding it, it would certainly greatly improve the overall quality — even if the text isn't perfectly readable, it would probably look much less ugly with less pixel noise.
-ConstanceJill (August 28, 2018, 08:42 AM)
What I did in photoshop was close to that (see description in my previous post). The result was more or less unreadable. (I didn't post screenshot of that.)
Tom