News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

My first program in MASM32

Started by i Z !, February 22, 2015, 09:46:17 PM

Previous topic - Next topic

FORTRANS

Hi Gunther,

Quote from: Gunther on February 27, 2015, 07:09:00 PM
interesting idea, indeed. That table could be used for a large range of standard images. But it must be clear that we've some kind of pathological pictures for which the color table will fail.

   While that may be true, dithering or error diffusion can fix a lot
of things that would otherwise be considered a failure.  A general
palette like Dave's is by definition not optimal for any given image.
But it is probably "good enough" for most if you add dithering.
Admittedly, for some personal choice of "good enough".  It
would probably be an interesting excursion to find some images
that fail to test for a better fail-safe palette.

    And it is easier to implement than any effective palette selection
algorithm.  Though probably less "fun" as well.  I have wasted too
much time investigating palette creation and the like.  Trying to
create an optimal 16 color palette, for a general purpose image, is
something of an oxymoron.

Cheers,

Steve N.

dedndave

here's a little toy for playing with Gamma   :P

it uses the equation:
Y = 255*(X/255)Gamma

it uses a DIB section, and allows the selection of grays, reds, greens, blues, magentas, cyans, or yellows
(if all the colors are turned off, it reverts to gray shades)

52Shades1.zip is the program download, with source

53Shades.png.zip is the picture
don't ask me how it got a different name   :lol:

Gunther

Steve,

Quote from: FORTRANS on February 28, 2015, 12:36:14 AM
I have wasted too much time investigating palette creation and the like.  Trying to create an optimal 16 color palette, for a general purpose image, is something of an oxymoron.

yes, that's true. Dave's proposal can save a lot of work, but could fail in some cases. That was my point. The idea is good and the pathological cases must be treated in a special way.

Gunther
You have to know the facts before you can distort them.

dedndave

Gunther,

i will continue to work on this - it will be a few days, at least - lol
in the mean time, i would really appreciate if you could find images that might fail   :t
i plan to combine several images into one - and i will add them to the mix

Gunther

Hi Dave,

Quote from: dedndave on March 03, 2015, 02:09:34 AM
Gunther,

i will continue to work on this - it will be a few days, at least - lol
in the mean time, i would really appreciate if you could find images that might fail   :t
i plan to combine several images into one - and i will add them to the mix

I'll do my best, even though my time is very limited at the moment. I've to prepare my pupils for the exams in mathematics end of April. But here you'll have an idea: Imagine a true color picture of a green meadow to sundown. That has a lot of different green and red tints. But inside the image should be a dark free telephone line between two pylons.

By downsampling from true color to 256 colors it's possible to lose the line or parts of it.

Gunther
You have to know the facts before you can distort them.

dedndave

i think you'll be surprised   :biggrin:

i know i was

Gunther

Quote from: dedndave on March 03, 2015, 10:37:46 AM
i think you'll be surprised   :biggrin:

i know i was

Why not? Go forward and surprise me.  :t

Gunther
You have to know the facts before you can distort them.