Bug 98706 - histogram visible while viewing photo
Summary: histogram visible while viewing photo
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: ImageEditor-Core (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-06 17:20 UTC by alfons.hoogervorst
Modified: 2022-01-08 11:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments
Blend the histogram on top of photos (12.09 KB, patch)
2005-02-06 17:22 UTC, alfons.hoogervorst
Details
Blend the histogram on top of photos (update 1) (15.43 KB, patch)
2005-02-07 00:44 UTC, alfons.hoogervorst
Details
Blend the histogram on top of photos (update 2) (17.39 KB, patch)
2005-02-07 23:25 UTC, alfons.hoogervorst
Details
Blend the histogram on top of photos (update 3) (18.20 KB, patch)
2005-02-09 16:25 UTC, alfons.hoogervorst
Details
Blend the histogram on top of photos (update 4) (27.97 KB, patch)
2005-03-13 13:23 UTC, alfons.hoogervorst
Details
Blend the histogram on top of photos (update 5) (30.81 KB, patch)
2005-03-15 23:11 UTC, alfons.hoogervorst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alfons.hoogervorst 2005-02-06 17:20:39 UTC
Version:           CVS (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3.1 From source
OS:                Linux

I needed the luminosity histogram to be visible while viewing photos, without needing to open a modal dialog for each photo. 
So I wrote a patch that just blends the "lumigram" on top of a photo. I don't know how and whether this is the right way to view lumigrams: maybe creating a floating window would have been better. For the time being, this works for me, and because I am not a KDE/QT hacker, I hope that the developers look into making the histogram a bit more accessible.
For an example, see here <http://hoogervorst.dyndns.org/~alfons/wordpress/index.php?p=136>.
Patch coming up shortly.
Comment 1 alfons.hoogervorst 2005-02-06 17:22:30 UTC
Created attachment 9447 [details]
Blend the histogram on top of photos

May show some update glitches while resizing.
Comment 2 alfons.hoogervorst 2005-02-07 00:44:18 UTC
Created attachment 9454 [details]
Blend the histogram on top of photos (update 1)

* updated to work with CVS
* some minor code changes in canvas.c
* also make histogram work for showfoto
Comment 3 Renchi Raju 2005-02-07 03:36:38 UTC
looks very interesting and i'm sure will be a useful addition. There are drawing glitches when scrolling. 
Comment 4 alfons.hoogervorst 2005-02-07 16:08:26 UTC
am working on the drawing glitches, expect a new patch soon.
Comment 5 alfons.hoogervorst 2005-02-07 23:25:24 UTC
Created attachment 9474 [details]
Blend the histogram on top of photos (update 2)

Here's a decent attempt to fix scrolling glitches. If you scroll to much it
still flickers a bit, but at least it's better than what update 1 had.
Comment 6 alfons.hoogervorst 2005-02-09 16:25:43 UTC
Created attachment 9503 [details]
Blend the histogram on top of photos (update 3) 

This patch fixes much of the flicker while scrolling.
Comment 7 caulier.gilles 2005-02-09 16:29:27 UTC
Renchi, you want to apply this patch to CVS before 0.7.2 finale ?

Gilles Caulier
Comment 8 Renchi Raju 2005-02-09 17:01:51 UTC
not yet. i will need to have a closer look at the patch first
Comment 9 caulier.gilles 2005-03-02 16:14:44 UTC
Patch apply on my computer. Implementation looking good. Result look good too, excepted 5 comments :

- 1/ the histogram isn't recomputed if any color changes have applied on current image (like normalize color filter for example)

- 2/ the histogram must be placed on left/right top/bottom place for let a maximum image area visible. Looking a photograph corner is normally less important than the center. The best solution is to provide a moving feature.

- 3/ Improvement : there no way to change the current histogram channel. Only 'Luminosity' is displayed. Provide an contextual menu with RGB color channel selection will be great.

- 4 / Please do not use tab caractor in your implementation, but only 4 white spce instead (:=)))

- 5/ Please re-create you patch for the current digikam cvs.

Renchi, digikam is now tagged for 0.7.2 release. I think the patch can be applied to cvs if is right for you. Your viewpoint ?

Note: I have provide a screenshoot at this url :

http://digikam3rdparty.free.fr/image_editor_with_blended_histogram.png

Gilles Caulier
Comment 10 alfons.hoogervorst 2005-03-02 18:17:28 UTC
>1/ the histogram isn't recomputed if any color changes have applied on current >image (like normalize color filter for example)

Yep. I had a hack that did this, but it required a new virtual in another place. Will do that.

> 2/ the histogram must be placed on left/right top/bottom place for let 
> a maximum image area visible. Looking a photograph corner is normally 
> less important than the center. The best solution is to provide a 
> moving feature. 

What about just clicking in the corners / inside the histogram? Left corner means that it sticks to the left edge etc? Does that sound agreeable? Will do that too.

> 3/ Improvement : there no way to change the current histogram channel. Only 
> 'Luminosity' is displayed. Provide an contextual menu with RGB color channel 
> selection will be great. 

Will do that, and thought about how to represent this in the menu; I guess a toggle menu item will do?

> 4/ Please do not use tab caractor in your implementation, but only 4 
> white spce instead (:=)))

> 5/ Please re-create you patch for the current digikam cvs.

Ah, yeah, tab vs. spaces. :-) Will do both of the two.




Comment 11 caulier.gilles 2005-03-02 18:26:49 UTC
Another problem too : move a plugin dialog under the histogram area and look like the histogram blending mode isn't correctly restored on the current image

A nice day

Gilles Caulier
Comment 12 caulier.gilles 2005-03-02 18:32:45 UTC
#2 : look in my screenshot. I have move the histogram position at canvas (with/6, height/6) for testing. It's in the top/left corner on the image like this (this is an example). 

About moving feature, just intercept the current mouse position when the cursor is under the histogram area an detect when left button is pressed. in this case, change the cursor form and change the center point of the histogram area accordinly with the mouse position.

Take a look in widget source code used in image editor plugins, like in Ratio crop tool.

Gilles Caulier
Comment 13 alfons.hoogervorst 2005-03-05 11:51:22 UTC
|Another problem too : move a plugin dialog under the histogram area 
|and look like |the histogram blending mode isn't correctly restored 
|on the current image

Yeah, the original repaint routine alphablended from the histogram's origin to the exposed rectangle, where it should only alphablend the exposed rectangle.

I'm working on most of the other issues - you can track progress here: http://hoogervorst.dyndns.org/cgi-bin/darcs.cgi/kdeextragear-3/digikam/?c=patches
Right now there's not much, but I'll commit the basic patch and incremental changes in a few hours or-so.
Comment 14 caulier.gilles 2005-03-05 18:55:57 UTC
OK. Have you an access to write in KDE CVS ?

If i commit this code in digikam repository (when it will finalized), it will be cool if you continue to contrib to digiKam project for maintaining this code in the future...

Gilles Caulier
Comment 15 alfons.hoogervorst 2005-03-13 13:23:16 UTC
Created attachment 10090 [details]
Blend the histogram on top of photos (update 4)

Thanks for the heads up. 
Here's an updated patch to play with. Most of the things you suggested are
there, with the exception of displaying histogram for the other channels. I
work on this this week.
Comment 16 caulier.gilles 2005-03-13 19:17:33 UTC
OK, cool...

I will checked your patch tomorrow morning and provide a feedback...

Thanks for your contibution.

Gilles Caulier
Comment 17 alfons.hoogervorst 2005-03-15 23:11:50 UTC
Created attachment 10137 [details]
Blend the histogram on top of photos (update 5)

Here's another update, now also allows you to switch between different color
channel histograms.
I'm doing minor refactoring on the code over the next days, so let me know
about any wishes, necessary fixes, etc.
Comment 18 caulier.gilles 2005-03-16 15:24:59 UTC
Look good. Accordinly with Joern Ahren, I will commit your code to cvs. All new fix will be apply directly on. Are you write cvs acces ? Do you want to continue to contrib in digiKam directly using kde repository ?

Gilles Caulier
Comment 19 caulier.gilles 2005-03-16 15:47:13 UTC
CVS commit by cgilles: 

Patch from Alfons Hoogervorst <alfons.hoogervorst@gmail.com> about histogram visible while viewing photo in digiKam image editor using blending.
CCBUGS: 98706
CCMAIL: digikam-devel@lists.sourceforge.net


  M +3 -2      showfoto/Makefile.am   1.8
  M +40 -0     showfoto/showfoto.cpp   1.23
  M +3 -0      showfoto/showfoto.h   1.16
  M +1 -0      showfoto/showfotoui.rc   1.12
  M +1 -0      utilities/imageeditor/Makefile.am   1.20
  M +519 -5    utilities/imageeditor/canvas.cpp   1.36
  M +20 -0     utilities/imageeditor/canvas.h   1.24
  M +2 -1      utilities/imageeditor/digikamimagewindowui.rc   1.8
  M +42 -0     utilities/imageeditor/imagewindow.cpp   1.91
  M +3 -0      utilities/imageeditor/imagewindow.h   1.38
Comment 20 Achim Bohnet 2005-03-16 16:04:53 UTC
CVS commit by ach: 

There a configure check for libjpegs name.   Make use of it.
CCBUGS:98706


  M +1 -1      kioslave/Makefile.am   1.14
  M +1 -1      showfoto/Makefile.am   1.9
  M +1 -1      utilities/cameragui/Makefile.am   1.12


--- kdeextragear-3/digikam/kioslave/Makefile.am  #1.13:1.14
@@ -7,5 +7,5 @@
 
 kio_digikamthumbnail_la_SOURCES = digikamthumbnail.cpp parse.c
-kio_digikamthumbnail_la_LIBADD = $(LIB_KIO) -ljpeg $(LIBPNG) 
+kio_digikamthumbnail_la_LIBADD = $(LIB_KIO) $(LIBJPEG) $(LIBPNG) 
 kio_digikamthumbnail_la_LDFLAGS = -module -avoid-version $(all_libraries) \
         $(KDE_PLUGIN) $(LIB_IMLIB2) $(LIBKEXIF_LIBS)

--- kdeextragear-3/digikam/showfoto/Makefile.am  #1.8:1.9
@@ -8,5 +8,5 @@
 
 showfoto_LDADD   = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) \
-                   $(LIB_KFILE) $(LIB_KPARTS) -ljpeg \
+                   $(LIB_KFILE) $(LIB_KPARTS) $(LIBJPEG) \
                    $(top_builddir)/digikam/utilities/imageeditor/libimagecanvas.la \
            $(top_builddir)/digikam/libs/histogram/libhistogram.la

--- kdeextragear-3/digikam/utilities/cameragui/Makefile.am  #1.11:1.12
@@ -12,5 +12,5 @@
 
 libcameragui_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) 
-libcameragui_la_LIBADD  = $(LIB_GPHOTO) $(LIBKEXIF_LIBS) -ljpeg
+libcameragui_la_LIBADD  = $(LIB_GPHOTO) $(LIBKEXIF_LIBS) $(LIBJPEG)
 
 INCLUDES= -I$(top_srcdir)/digikam/digikam \
Comment 21 Joern Ahrens 2005-06-11 12:24:42 UTC
Since Alfons' nice work is already applied to digikam, we can close this wish.
Comment 22 gsasha 2005-08-10 16:53:29 UTC
Alfons,

I have done several enhancements to the Image Editor, including some refactoring of the Histogram code. Could you please take a look? It's submitted as KDE bug #110514.