• [MOD] Histogram 4 0 5 1
Currently:  

Author Topic: [MOD] Histogram  (Read 222057 times)

0 Members ve 1 Ziyaretēi konuyu incelemekte.

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
[MOD] Histogram
« on: Žubat 23, 2006, 07:54:23 ÖÖ »
It is possible to make something like this http://coppermine-gallery.net/forum/index.php?topic=18759.0 for 4image gallery ?
« Last Edit: Nisan 29, 2006, 12:43:05 ÖÖ by om6acw »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [req mod] histogram
« Reply #1 on: Žubat 23, 2006, 08:06:48 ÖÖ »
I didnt get what does it represent and what is it for? what use of it?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)


Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [req mod] histogram
« Reply #3 on: Žubat 23, 2006, 08:24:50 ÖÖ »
I didnt get what does it represent and what is it for? what use of it?

That script is to make a graph created from picture and show if it is overexposed or underexposed, that mod is used freqently by photographers.

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [req mod] histogram
« Reply #4 on: Žubat 23, 2006, 11:32:42 ÖÖ »
that mod is used freqently by photographers.

 :?: so the first question should be : is there a php script (or a class or any other script) which is able to do a picture histogram (like a digital camera  :wink: ) ?  so if the answer is no, surely it  means that it  should not be easy to do it. but who knows?

well, i think it's possible with GD or imagemagick but for the moment, all the questions i found on the net about this have no answer....
...for the moment...  :roll:
« Last Edit: Žubat 23, 2006, 11:47:47 ÖÖ by cheribibi »
ch€ri{Bi}²


Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [req mod] histogram
« Reply #5 on: Žubat 23, 2006, 11:55:54 ÖÖ »
there is a file:

http://www.phpclasses.org/browse/file/4643.html

The problem would be to integrate it into 4images. Thats where v@no or any other good coder can help, if he want to.

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [req mod] histogram
« Reply #6 on: Žubat 23, 2006, 02:12:12 ÖS »
hmmm - why do you need this - just because it could be possible!

a fotografer have to controll his picture at home, where he could do some corection, and not on a Server in the web.

sincerly
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [req mod] histogram
« Reply #7 on: Žubat 23, 2006, 02:49:55 ÖS »
a fotografer have to controll his picture at home, where he could do some corection, and not on a Server in the web.
But...that mod is for server...for the home people are using photoshop ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [req mod] histogram
« Reply #8 on: Žubat 23, 2006, 03:39:11 ÖS »
@V@no
so it is more a fun function - because you can't change a uploadet picture on the server!  :?
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [req mod] histogram
« Reply #9 on: Žubat 24, 2006, 05:58:45 ÖÖ »
hmmm - why do you need this - just because it could be possible!

a fotografer have to controll his picture at home, where he could do some corection, and not on a Server in the web.

sincerly
vincent

I dont need that for corection of pictures on server, I need to show histogram because I want to show to customer that picture is corectly exposed. There is no way to see how a picture is exposed without histogram.

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [req mod] histogram
« Reply #10 on: Žubat 24, 2006, 06:04:48 ÖÖ »
that mod is used freqently by photographers.

 :?: so the first question should be : is there a php script (or a class or any other script) which is able to do a picture histogram (like a digital camera  :wink: ) ?  so if the answer is no, surely it  means that it  should not be easy to do it. but who knows?

well, i think it's possible with GD or imagemagick but for the moment, all the questions i found on the net about this have no answer....
...for the moment...  :roll:

php script is here :

Code: [Select]
<?php
//      Histogram creation
//      Created by Anton Sparrius (Spaz) 6/9/05  anton_spaz@yahoo.com
//      Free to use and change, provided you keep these lines :)
//
                        
$image $_REQUEST['image'];
                        
$filepath $_REQUEST['filepath'];
                        
$path "albums/".$filepath;

                        
$hist_file="hist_".substr($image,0,strlen($image)-4).".png";


                        if (
file_exists($path.$hist_file)) {
                          
$im=imagecreatefromPNG($path $hist_file);
                          
imagePNG($im);
                          
imagedestroy($im);
                        } else {
                        
$im=imagecreatefromjpeg($path.$image);
                        for(
$i=0;$i<imagesx($im);$i+=2)
                        {
                                for(
$j=0;$j<imagesy($im);$j++)
                                {
                                        
$rrggbb=imagecolorsforindex ($imimagecolorat($im,$i,$j));
                                        
$r[$rrggbb['red']]+=1;
                                        
$g[$rrggbb['green']]+=1;
                                        
$b[$rrggbb['blue']]+=1;
                                }
                        }
                        for (
$i=0;$i<256;$i++)
                        {
                                
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
                        }
                        
$max_value=max($max)/150;
                        
$m[0]=max($r);
                        
$m[1]=max($b);
                        
$m[2]=max($g);
                        
$max_rgb=max($m)/150;

                        
$im_out imageCreate (280164);
                        
$background imageColorAllocate($im_out,70,70,70);
                        
$hist=ImageColorAllocate($im_out,171,205,239);
                        
$white=ImageColorAllocate($im_out,255,255,255);
                        
$red=ImageColorAllocate($im_out,255,0,0);
                        
$green=ImageColorAllocate($im_out,0,255,0);
                        
$blue=ImageColorAllocate($im_out,0,0,255);
                        
$ry=107;
                        
$gy=107;
                        
$by=107;

                        for(
$i=0;$i<256;$i++)
                        {
                                
imageLine($im_out$i+14157$i+14157-($max[$i]/$max_value),$white);
                                
imageLine($im_out$i+13$ry$i+14157-($r[$i]/$max_rgb), $red);
                                
imageLine($im_out$i+13$gy$i+14157-($g[$i]/$max_rgb), $green);
                                
imageLine($im_out$i+13$by$i+14157-($b[$i]/$max_rgb), $blue);
                                
$ry=157-($r[$i]/$max_rgb);
                                
$gy=157-($g[$i]/$max_rgb);
                                
$by=157-($b[$i]/$max_rgb);
                        }
                        
imageLine($im_out,13,158,270,158,$hist);
                        
imageLine($im_out,13,6,270,6,$hist);
                        
imageLine($im_out,13,6,13,158,$hist);
                        
imageLine($im_out,270,6,270,158,$hist);

                        
imagePNG($im_out,$path $hist_file);
                        
imageDestroy($im);
                        
imagedestroy($im_out);
                        
$im=imagecreatefromPNG($path $hist_file);
                        
imagePNG($im);
                        
imagedestroy($im);
                        }
?>


but I dont now how I can put this to 4image

On coppermine gallery looks like this (see attachment)

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [req mod] histogram
« Reply #11 on: Žubat 27, 2006, 09:07:21 ÖS »
Histogramm in 4images :

Die Diskusion ist sicher berechtigt, in wie weit die Präsentation des Histogramms zu einem Bild auf der Website sinnvoll ist. Wer dieses Tool also auf seiner Website einsetzen möchte, sollte sich das vorher klar machen. Ich denke aber in einer "Fotografen-Galerie" kann man davon zur Bildbeurteilung durchaus Gebrauch machen, zumal die User die sich auf so einer Website tummeln sicher auch etwas damit anfangen können. Auf der anderen Seite kann man sich heute bereits in den Digicams das Histogramm zum frisch geschossenen Bild anzeigen lassen.

Ich habe das Histogramm für 4images mal mit folgendem Ergebnis umgesetzt :

Zu sehen und zu testen hier : Test Histogramm in 4images

In dem von mir modifizierten details.php-Code für das Histogramm können die Dateitypen festgelegt werden, für die das Histogramm angezeigt werden soll, da nur eine beschränkte Dateien-Auswahl dafür in Betracht kommt. Sinnvoll sind hier sicher nur Dateien mit der Extensionen ... *.jpg und *.jpeg ! Doch die Auswahl steht dir zur Konfiguration offen.

Für die Umsetzung wäre nun folgendes zu erledigen.


[edit_10.02.2010]

Habe die hier ursprünglich veröffentlichte Version entfernt, da diese noch nicht ausgereift war. Obwohl das hier vermerkt war, wurde trotzdem immer wieder versucht diese Version zu installieren, obwohl ich hier bereits auf eine ausgereifte Version zum Download hingewiesen hatte. Da ich nicht immer wieder darauf in diesem Thread hinweisen will und mir anhören muss ... funktioniert nicht ... habe ich diese Vorversion entfernt.

[/edit_10.02.2010]


P.S. zur Arbeitsweise dieser Modifikation :
- mit Aufruf der Detailseite wird nach dem Check des Dateityps über die histo.php das Histogramm als Bilddatei erzeugt
- dieser Vorgang kann u.U. etwas Zeit in Anschruch nehmen bis das Histogramm auf der Detailseite angezeigt wird
- diese Histogramm-Datei hist_dateiname.png wird dann im gleichen Ordner wie das Original-Bild gespeichert
- bei wiederholtem Aufruf der Detailseite wird nun das bereits vorhandene Histogramm als Bild geladen
- dieser Vorgang verläuft dann natürlich schneller


@all
... I redesigned this MOD with some fixes ...
... you can download all neccesary files and the installations instruction ... Download - MOD Histogram ...

@alle
... ich habe den MOD neu gestaltet mit einigen Fixes ...
... du kannst alle notwendigen Dateien und die Installationsanweisung downloaden ... Download - MOD Histogramm ...

Beispiel / Example :
Hier ein mit dem aktuellen MOD generiertes Histogramm von dem Bild, welches auch über den oben aufgeführten Test-Link zu sehen ist ...

« Last Edit: Žubat 10, 2010, 05:12:40 ÖS by mawenzi »
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [req mod] histogram
« Reply #12 on: Žubat 27, 2006, 11:00:15 ÖS »
@mawenzi : It seems very good...
:?: Is there a chance to get it in english ?  :wink:
Thanks!
ch€ri{Bi}²


Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [req mod] histogram
« Reply #13 on: Žubat 27, 2006, 11:11:31 ÖS »
wow! thank you very much for this!

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [req mod] histogram
« Reply #14 on: Žubat 27, 2006, 11:25:58 ÖS »
thanks a lot mawenzi :!: :!: :!:
« Last Edit: Mart 01, 2006, 06:40:00 ÖÖ by om6acw »