Re: rgb -> hsv and back



Am Dienstag, den 22.04.2008, 14:05 +0200 schrieb Stephane Delcroix:
> On Mon, 2008-04-21 at 16:32 +0200, Georg Leugner wrote:
> > So it has been done... I implemented RGB to HSV, or be precise HSI, at
> > my own, because I didn't get the lcms stuff...
> > I'm a little bit disappointed, because the result is in gray is more
> > impressive, but I have some more ideas.
> > 
> > So let's come to the good things:
> > * the result is most of the time nicer than the "Histogram Equalizer" in
> > gthumb and that is the same algorithm.
> nicer with the same algorithm ? we're is the magic ?

I didn't look into their source code. But I think they are using the HSV
color space and I implemented it in HSI. I'm working with the I
component ((r+g+b)/3 ), which is more exact than the V (max (r,g,b)).

> 
> > * the result is in dark images most of the time nicer than 'color
> > improve' from f-spot
> > 
> > Now to the ugly stuff:
> > * I am maybe not too objective about the quality of output image
> am ok to try that on some of mines
> > * noise and image can be seen better
> as expected
> > * the performance could be really improved. Help wanted.
> doing the conversion in managed code (c#) is expensive (due to the
> additional checks), rewriting the conversions in C, or better with
> mmx/sse will probably kick ass, but that could be done later...
> > * the conversion from RGB to HSI and back again manipulates the image
> > due to rounding faults. More Help wanted...
> as expected. as long as the diff is minimal (1 bit per channel) it's ok
> > 
> > I put the code into src/Filters (that's not a good place for
> > HSIImage.cs, i know...).
> 
> could you please also send the patch to f-spot you used to test the
> feature (even if you think it's ugly (like reusing the autocolor
> button :) ))

Why did you know that? I used even more ugly the tilt filter to test my
filter and color filter together. 

> 
> regards
> 
> s
> > 
> > Regards,
> > 
> > georg
> > 
> > 
> > Am Montag, den 14.04.2008, 10:58 -0500 schrieb Larry Ewing:
> > > The interactive color adjustment dialog does a lot of this sort of
> > > transform but it does it via an adjustment profile that it creates on
> > > the fly.  It may be hard to follow the code because we use lcms and the
> > > actual image color profile to convert to luminance space, adjust, then
> > > convert back again in single pass. That code could be adapted to convert
> > > to a colorspace of your choosing which could then be used collect the
> > > statistics you want to create an adjustment back to rgb.
> > > 
> > > If you would like try that direction I can help walk you through the
> > > darker corners of the code.  Otherwise as Stephane points our there
> > > isn't much existing infrastructure to help you out at the moment.
> > > 
> > > --Larry 
> > > 
> > > On Mon, 2008-04-14 at 14:37 +0200, Stephane Delcroix wrote:
> > > > Hey,
> > > > 
> > > > 1. no, there's no doc but the code itself...
> > > > 2. AFAIK, (Gdk)pixbuf doesn't support HSV. so "converting a RGB pixbuf
> > > > to HSV" doesn't make a lot of sense
> > > > so, you'll probably have to do the RGB->HSV conversion (and back)
> > > > yourself, but you might find some converter already available on the
> > > > web. My .02€ tip: don't do that in managed code, it'll be way too slow.
> > > > 
> > > > s
> > > > 
> > > > On Sun, 2008-04-13 at 19:59 +0200, Georg Leugner wrote:
> > > > > Hallo,
> > > > > 
> > > > > I'm currently coding on the one click contrast filter like picassa has.
> > > > > But I need some information:
> > > > > 1. First and most important. Is there somewhere hidden more
> > > > > documentation than on the get involved page?
> > > > > 2. I need to convert a RGB pixbuf to HSV. I couldn't find a method which
> > > > > does that, but i found some methods using hue, saturation... Do I miss
> > > > > something?
> > > > > 
> > > > > Kind regards,
> > > > > 
> > > > > georg
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > F-spot-list mailing list
> > > > > F-spot-list gnome org
> > > > > http://mail.gnome.org/mailman/listinfo/f-spot-list
> > > > > 
> > > > 
> > > > _______________________________________________
> > > > F-spot-list mailing list
> > > > F-spot-list gnome org
> > > > http://mail.gnome.org/mailman/listinfo/f-spot-list
Index: ItemAction.cs
===================================================================
--- ItemAction.cs	(Revision 3827)
+++ ItemAction.cs	(Arbeitskopie)
@@ -263,6 +263,7 @@
 		protected override IFilter BuildFilter ()
 		{
 			return new AutoStretch ();
+//			return new HistogramEqualizer();
 		}
 	}
 
@@ -279,7 +280,8 @@
 
 		protected override IFilter BuildFilter ()
 		{
-			return new TiltFilter (angle);
+			return new HistogramEqualizer ();
+			//return new TiltFilter (angle);
 		}
 	}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]