Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #5375 > unrolled thread

darkening colour

Started byfir <profesor.fir@gmail.com>
First post2015-04-06 01:12 -0700
Last post2015-04-07 01:12 -0700
Articles 6 on this page of 26 — 3 participants

Back to article view | Back to comp.programming


Contents

  darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 01:12 -0700
    Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-06 10:52 +0200
      Re: darkening colour Bartc <bc@freeuk.com> - 2015-04-06 11:21 +0100
        Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-06 12:44 +0200
          Re: darkening colour Bartc <bc@freeuk.com> - 2015-04-06 12:54 +0100
            Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-06 14:27 +0200
            Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 05:51 -0700
      Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 04:38 -0700
        Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-06 14:52 +0200
          Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 06:25 -0700
            Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-06 17:02 +0200
              Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 09:36 -0700
                Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-07 10:52 +0200
                  Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-07 02:10 -0700
                    Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-07 11:30 +0200
                      Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-07 03:24 -0700
                        Re: darkening colour "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-04-07 13:00 +0200
        Re: darkening colour Bartc <bc@freeuk.com> - 2015-04-06 14:17 +0100
          Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 06:27 -0700
            Re: darkening colour Bartc <bc@freeuk.com> - 2015-04-06 14:39 +0100
              Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 06:48 -0700
                Re: darkening colour Bartc <bc@freeuk.com> - 2015-04-06 16:02 +0100
                  Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-06 09:44 -0700
                    Re: darkening colour Bartc <bc@freeuk.com> - 2015-04-06 21:05 +0100
                      Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-07 00:51 -0700
                        Re: darkening colour fir <profesor.fir@gmail.com> - 2015-04-07 01:12 -0700

Page 2 of 2 — ← Prev page 1 [2]


#5388

Fromfir <profesor.fir@gmail.com>
Date2015-04-06 06:48 -0700
Message-ID<074c34c3-d929-497c-a7b1-cab576354c2f@googlegroups.com>
In reply to#5387
W dniu poniedziałek, 6 kwietnia 2015 15:39:45 UTC+2 użytkownik Bart napisał:
> On 06/04/2015 14:27, fir wrote:
> > W dniu poniedziałek, 6 kwietnia 2015 15:17:32 UTC+2 użytkownik Bart napisał:
> >> On 06/04/2015 12:38, fir wrote:
> 
> >>> ps for desaturation i use such code
> >>>
> >>>      float r = color.r;
> >>>      float g = color.g;
> >>>      float b = color.b;
> >>>
> >>> float p = sqrt( r*r*.299 + g*g*.587 + b*b*.114 ) ;
> >>
> >> Where is that formula from? Colour TV used to use:
> >>
> >>    Y = r*0.3 + g*0.6 +b*0.1
> >>
> >
> > bnot sure uf you dont see that those two are the same (i found it as a random junk in google
> 
> If the two formulae do the same thing, then you're going a long way 
> about it! Working out squares and square roots...
> 
> > http://alienryderflex.com/saturation.html
> 
> That doesn't explain it either. Why don't you just try the simpler 
> formula and see it if makes a visible difference? If not, then you can 
> try and see if a table lookup is quicker.
> 
> (I would say that most people wouldn't be able to tell if the colour 
> balance is not quite right on a partly desaturated image. Such an image 
> is unnatural anyway.)
> 
this sesaturation is working enough okay as for this moment 

you may test it 
https://www.dropbox.com/s/3nm8q09fesoksxa/v21.zip?dl=0
(no malware as i said)

Now i need to obtain better darkening/brightening recipe than (r,g,b)*f

without reading tomes of color theory, I need better understanding but in possibly strightforward way - when confronting with something "too alien" (like scientific papers
or complex project sources) i usually gave up
(but maybe i will find something)

[toc] | [prev] | [next] | [standalone]


#5389

FromBartc <bc@freeuk.com>
Date2015-04-06 16:02 +0100
Message-ID<mfu747$pn9$1@dont-email.me>
In reply to#5388
On 06/04/2015 14:48, fir wrote:
> W dniu poniedziałek, 6 kwietnia 2015 15:39:45 UTC+2 użytkownik Bart napisał:
>> On 06/04/2015 14:27, fir wrote:

>> That doesn't explain it either. Why don't you just try the simpler
>> formula and see it if makes a visible difference? If not, then you can
>> try and see if a table lookup is quicker.
>>
>> (I would say that most people wouldn't be able to tell if the colour
>> balance is not quite right on a partly desaturated image. Such an image
>> is unnatural anyway.)
>>
> this sesaturation is working enough okay as for this moment
>
> you may test it
> https://www.dropbox.com/s/3nm8q09fesoksxa/v21.zip?dl=0
> (no malware as i said)

I don't know what I'm supposed to be looking at here. What is the 
problem you're trying to solve? Are any of these before and after?

But the rendering is crude enough that I doubt many will notice if the 
colour balance is a bit off.

Some of the objects do have garish (ie. highly saturated) colours, but 
that would just be a bad choice of base colour: you can 'desaturate' by 
choosing a different colour. You do't need to deal with it by complex 
real-time per-pixel transformations.

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#5392

Fromfir <profesor.fir@gmail.com>
Date2015-04-06 09:44 -0700
Message-ID<df02d7fe-4e9a-408d-acb7-fb14ba8a0b21@googlegroups.com>
In reply to#5389
W dniu poniedziałek, 6 kwietnia 2015 17:02:28 UTC+2 użytkownik Bart napisał:
> On 06/04/2015 14:48, fir wrote:
> > W dniu poniedziałek, 6 kwietnia 2015 15:39:45 UTC+2 użytkownik Bart napisał:
> >> On 06/04/2015 14:27, fir wrote:
> 
> >> That doesn't explain it either. Why don't you just try the simpler
> >> formula and see it if makes a visible difference? If not, then you can
> >> try and see if a table lookup is quicker.
> >>
> >> (I would say that most people wouldn't be able to tell if the colour
> >> balance is not quite right on a partly desaturated image. Such an image
> >> is unnatural anyway.)
> >>
> > this sesaturation is working enough okay as for this moment
> >
> > you may test it
> > https://www.dropbox.com/s/3nm8q09fesoksxa/v21.zip?dl=0
> > (no malware as i said)
> 
> I don't know what I'm supposed to be looking at here. What is the 
> problem you're trying to solve? Are any of these before and after?
> 
> But the rendering is crude enough that I doubt many will notice if the 
> colour balance is a bit off.
> 
> Some of the objects do have garish (ie. highly saturated) colours, but 
> that would just be a bad choice of base colour: you can 'desaturate' by 
> choosing a different colour. You do't need to deal with it by complex 
> real-time per-pixel transformations.
> 

So you tested it? (I thought nobody was testing it as they afraid of malware) 
Desaturation routine is seen when toggle 'q'

The problem? I want to general improve visual quality - thus i feel a need to test variious options etc
Esp darkening/brightening i could use when doing shading of triangles to see if effect is 
not a bit better/more clear
..so the problem is general, understanding and testing (learning, working) etc


> -- 
> Bartc

[toc] | [prev] | [next] | [standalone]


#5393

FromBartc <bc@freeuk.com>
Date2015-04-06 21:05 +0100
Message-ID<mfuosh$2oe$1@dont-email.me>
In reply to#5392
On 06/04/2015 17:44, fir wrote:
> W dniu poniedziałek, 6 kwietnia 2015 17:02:28 UTC+2 użytkownik Bart napisał:

>> I don't know what I'm supposed to be looking at here. What is the
>> problem you're trying to solve? Are any of these before and after?
>>
>> But the rendering is crude enough that I doubt many will notice if the
>> colour balance is a bit off.
>>
>> Some of the objects do have garish (ie. highly saturated) colours, but
>> that would just be a bad choice of base colour: you can 'desaturate' by
>> choosing a different colour. You do't need to deal with it by complex
>> real-time per-pixel transformations.
>>
>
> So you tested it? (I thought nobody was testing it as they afraid of malware)
> Desaturation routine is seen when toggle 'q'

Sure.

> The problem? I want to general improve visual quality - thus i feel a need to test variious options etc
> Esp darkening/brightening i could use when doing shading of triangles to see if effect is
> not a bit better/more clear

OK, pressing Q in program22 and 23 (I can't remember 24), gives a 
gradual fade to black&white over the image.

If that's all you want, then I'm fairly certain that the simple 
luminance formula (the one that could be reduced to lookups) will work 
just as well.

But if you're concerned about the appearance, I'm not sure that's the 
right approach. If you don't want strong colours, then just start with 
less saturated colours in the first place! It doesn't look like you're 
attempting photo-realism so a 1% difference in correct colour balance is 
not going to be important.

There are also a lot of artefacts in the shading (especially on the 
solar panels of the space vehicle, if that's what they are) that could 
do with looking at.

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#5394

Fromfir <profesor.fir@gmail.com>
Date2015-04-07 00:51 -0700
Message-ID<1c953524-b969-45fc-b01f-fd7f5d84def3@googlegroups.com>
In reply to#5393
W dniu poniedziałek, 6 kwietnia 2015 22:05:30 UTC+2 użytkownik Bart napisał:
> On 06/04/2015 17:44, fir wrote:
> > W dniu poniedziałek, 6 kwietnia 2015 17:02:28 UTC+2 użytkownik Bart napisał:
> 
> >> I don't know what I'm supposed to be looking at here. What is the
> >> problem you're trying to solve? Are any of these before and after?
> >>
> >> But the rendering is crude enough that I doubt many will notice if the
> >> colour balance is a bit off.
> >>
> >> Some of the objects do have garish (ie. highly saturated) colours, but
> >> that would just be a bad choice of base colour: you can 'desaturate' by
> >> choosing a different colour. You do't need to deal with it by complex
> >> real-time per-pixel transformations.
> >>
> >
> > So you tested it? (I thought nobody was testing it as they afraid of malware)
> > Desaturation routine is seen when toggle 'q'
> 
> Sure.
> 
> > The problem? I want to general improve visual quality - thus i feel a need to test variious options etc
> > Esp darkening/brightening i could use when doing shading of triangles to see if effect is
> > not a bit better/more clear
> 
> OK, pressing Q in program22 and 23 (I can't remember 24), gives a 
> gradual fade to black&white over the image.
> 
> If that's all you want, then I'm fairly certain that the simple 
> luminance formula (the one that could be reduced to lookups) will work 
> just as well.
> 
> But if you're concerned about the appearance, I'm not sure that's the 
> right approach. If you don't want strong colours, then just start with 
> less saturated colours in the first place! It doesn't look like you're 
> attempting photo-realism so a 1% difference in correct colour balance is 
> not going to be important.
> 
> There are also a lot of artefacts in the shading (especially on the 
> solar panels of the space vehicle, if that's what they are) that could 
> do with looking at.
> 

as i said desaturation is not of my concern 
now.. I need up-saturation, proper dargening, brighting, changing hue, and other potentially usable effects

(this prog of my is not only prog (some early prototype of some game) but also demo
of my graphics library, Im working on both

in general i need improve efficiency and improve quality (maybe i am more focused on efficiency as perpixel graphics is slow0
[for example if you hold w you got wire-model
and you see that it is slower than fill
triangles.. would like to optimise it too,
drawline code was on comp.lang.c

in general 
mouse wheel up makes app fullscreen
mouse wheel down makes pause releases the mouse arrow
control + 3,4,5,6 changes the resolution
pressing left shift + mouse makes strafe moves

ps to test better to run the last one prog, (here program24)

also to need build some simple models form tetrahedrons solid_model.txt is model file
where you define tetrahedrons to build some simple model this way, i need to build some
simple ship model from it



> -- 
> Bartc

[toc] | [prev] | [next] | [standalone]


#5395

Fromfir <profesor.fir@gmail.com>
Date2015-04-07 01:12 -0700
Message-ID<4c1b067f-aae3-46ea-8e2c-af54ed00beec@googlegroups.com>
In reply to#5394
W dniu wtorek, 7 kwietnia 2015 09:51:16 UTC+2 użytkownik fir napisał:
> W dniu poniedziałek, 6 kwietnia 2015 22:05:30 UTC+2 użytkownik Bart napisał:
> > On 06/04/2015 17:44, fir wrote:
> > > W dniu poniedziałek, 6 kwietnia 2015 17:02:28 UTC+2 użytkownik Bart napisał:
> > 
> > >> I don't know what I'm supposed to be looking at here. What is the
> > >> problem you're trying to solve? Are any of these before and after?
> > >>
> > >> But the rendering is crude enough that I doubt many will notice if the
> > >> colour balance is a bit off.
> > >>
> > >> Some of the objects do have garish (ie. highly saturated) colours, but
> > >> that would just be a bad choice of base colour: you can 'desaturate' by
> > >> choosing a different colour. You do't need to deal with it by complex
> > >> real-time per-pixel transformations.
> > >>
> > >
> > > So you tested it? (I thought nobody was testing it as they afraid of malware)
> > > Desaturation routine is seen when toggle 'q'
> > 
> > Sure.
> > 
> > > The problem? I want to general improve visual quality - thus i feel a need to test variious options etc
> > > Esp darkening/brightening i could use when doing shading of triangles to see if effect is
> > > not a bit better/more clear
> > 
> > OK, pressing Q in program22 and 23 (I can't remember 24), gives a 
> > gradual fade to black&white over the image.
> > 
> > If that's all you want, then I'm fairly certain that the simple 
> > luminance formula (the one that could be reduced to lookups) will work 
> > just as well.
> > 
> > But if you're concerned about the appearance, I'm not sure that's the 
> > right approach. If you don't want strong colours, then just start with 
> > less saturated colours in the first place! It doesn't look like you're 
> > attempting photo-realism so a 1% difference in correct colour balance is 
> > not going to be important.
> > 
> > There are also a lot of artefacts in the shading (especially on the 
> > solar panels of the space vehicle, if that's what they are) that could 
> > do with looking at.
> > 
> 
> as i said desaturation is not of my concern 
> now.. I need up-saturation, proper dargening, brighting, changing hue, and other potentially usable effects
> 
> (this prog of my is not only prog (some early prototype of some game) but also demo
> of my graphics library, Im working on both
> 
> in general i need improve efficiency and improve quality (maybe i am more focused on efficiency as perpixel graphics is slow0
> [for example if you hold w you got wire-model
> and you see that it is slower than fill
> triangles.. would like to optimise it too,
> drawline code was on comp.lang.c
> 
> in general 
> mouse wheel up makes app fullscreen
> mouse wheel down makes pause releases the mouse arrow
> control + 3,4,5,6 changes the resolution
> pressing left shift + mouse makes strafe moves
> 
> ps to test better to run the last one prog, (here program24)
> 
> also to need build some simple models form tetrahedrons solid_model.txt is model file
> where you define tetrahedrons to build some simple model this way, i need to build some
> simple ship model from it
> 
> 
> 

ps i found something simple

From RGB to YIQ

y = r* 0.299 + g*  0.587 + b*  0.114 
i = r* 0.596 + g* -0.275 + b* -0.321 
q = r* 0.212 + g* -0.528 + b*  0.311

From YIQ to RGB

r = y* 1 + i*  0.956 + q*  0.620 
g = y* 1 + i* -0.272 + q* -0.647 
b = y* 1 + i* -1.108 + q*  1.705

y is said to be luma and I Q is mixed
chroma, maybe inc/dec of this luma will
give somewhat better result

it seems that it is worse than those Lab
or something but easier

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.programming


csiph-web