Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th February 2017, 16:29   #1  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Find color palette

I wonder if it's possible to get color palette, like the ones found in the following websites:

https://twitter.com/cinemapalettes
http://moviesincolor.com

Thanks in advance to anyone that would eventually find a solution!
spoRv is offline   Reply With Quote
Old 27th February 2017, 16:53   #2  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Something similar was discussed here: http://forum.doom9.org/showthread.php?t=167769
There's even a plugin in post #28.

Hope it helps.
Reel.Deel is offline   Reply With Quote
Old 27th February 2017, 21:21   #3  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Reel.Deel, thanks for the link! Didn't know that function, but I use MovieBarCode, that seems similar.

I tried to use the function in post #25 but it works only for video (no audio graph overlaid), while audio function alone found in the previous post #24 works...

What I'd like to get is some colored boxes like the ones found in the linked pages in the first post, or, in alternative, sort somehow the lines of the Fingerprint (or MovieBarCode) by color...
spoRv is offline   Reply With Quote
Old 27th February 2017, 21:32   #4  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
I was wondering could we make a script showing a number of pallets for a frame or multiple frames by converting to a perceptual colorspace, e.g. a space where the Euclidean distance between RGB values is equivalent to our perception of color difference (would the LAB color space be useful for this?) then grouping all pixels by a number of clusters, then ordering each group and averaging them, to eventually wind up with a frame with a number patches of colors?

Last edited by Cary Knoop; 4th March 2017 at 02:34.
Cary Knoop is offline   Reply With Quote
Old 3rd March 2017, 17:33   #5  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
I modified slightly the MovieBarCode script [link] to obtain just the color average instead resized frame.

Now I wonder if someone could chime in, and write a script that will get them sorted as #000000 -> #FFFFFF, and, if possible, get the most used colors (and surrounding ones) as a palette of a given X numer - like the ones found in the first post links.

spoRv is offline   Reply With Quote
Old 4th March 2017, 00:12   #6  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Speaking of palette grabbers, have you seen this? Quite amazing.

Get a palette from an image using different desired "moods"...

(See the circles in the image? They are the color samples, chosen by the program. You can drag them around to select different colors)

Manually choose a "main" color (or start from the image palette above) and let the page suggest some others, based on color rules
("complementary", "analogous", etc)

Last edited by raffriff42; 16th March 2017 at 14:37. Reason: (fixed image links)
raffriff42 is offline   Reply With Quote
Old 4th March 2017, 00:38   #7  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
It's a great tool! But not what I'm looking for...

I'm pretty sure that it's possible to do that, the fact is I don't know how... one possible way that I thought (but not the best to follow) is to save any the desired frame (averaged colors and reduced to, let's say, 1x1 pixel) as png images with its hex color, and then read them all, sorted by name, stacked as a color bar... ugly technique, uh? But it should work - I think.
spoRv is offline   Reply With Quote
Old 4th March 2017, 03:49   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
sporV, below takes you part way there. (3rd function example. not terribly fast).
https://forum.doom9.org/showthread.p...96#post1799396

EDIT: Taking only the most significant x number of bits of each color primary (and rounding where necessary)
would reduce the sort times and probably give more manageable results, you want this ?
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th March 2017 at 07:11.
StainlessS is offline   Reply With Quote
Old 4th March 2017, 12:17   #9  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
StainlessS, you are my hero!

Yep, most significant bits would be probably the best way to go, to get a limited palette.
What I would get are the 16 most used colors, with two sets of variables, one sorted by use (use01...use16) where use01 is the most used, and use16 is the 16th most used, and one sorted by color (col01...col16) where col01 would be #00 and col16 would be #FF. Related percentages variables (absolute in relation to all the color present, and in relation only with those 16 colors) would be really appreciated...

I get the average color of each frame using this line borrowed by Gavino here:

Code:
mt_lutf(last, mode="avg", expr="x", u=3, v=3)
but sometimes I feel it's not... right... can't explain...
I tried to do this before the average:

Code:
pointresize(4,4)
and result is different. But which could be right one to get the "color feel" of each frame? Or, maybe, it would be better to use the most used color (#xx)?

Another question, unrelated - eventually I would start a new post: I would like also to get info from Mediainfo - resolution, bitrate etc.; the best way would be copy data & paste into a txt file, then let Avisynth read it; something like this, but I cannot find the right way... may you write a simple script to just get two or three vars? Just to get a template...

I know I'm a pain in the... neck!
spoRv is offline   Reply With Quote
Old 4th March 2017, 14:47   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I was thinking maybe reduce to 4 bits per channel (3*4 = 12 bits = 4096 colors [max possible]). Would still need some decision work on which to choose.
2 bits (*3=6 bits = 64 colors) would not I think be a good idea.
I did something like above on Amiga, picking blackest black, whitest white, redest red, greenest green and bluest blue.
Remainder were I think chosen based on mixture of color counts, dithering mixture result when mixed with already chosen colors, and
horizontal edges (for HAM Hold and Modify mode register colors).

There is something here on MediaInfo use:- https://forum.doom9.org/showthread.p...14#post1759514

And something by Martin53 from PM, not sure if I've changed anything (fragment of bigger script).

Code:
Function GetMediaInfo(string s) {
    sFile = RT_GetFullPathName(RT_LocalTimeString() + ".avs")
    sCommand = """CMD /C chcp 1252>nul && MediaInfo --Output=Video;fc=0%FrameCount%\nnof=0%NumberOfFrames%\nfr=0%FrameRate%\n""" + 
        \ """fr_nom=0%FrameRate_Nominal%\nduration=0%Duration%\nPAR=0%PixelAspectRatio% """ + RT_QuoteStr(s) + " >" + RT_QuoteStr(sFile)
    CallCmd(BlankClip, Open=sCommand, Hide=true, debug=false, Synchronous=7)
    Import(sFile)
    RT_FileDelete(sFile)
    global MediaInfoFramerate = fr>0 ? float(fr) : float(fr_nom) # if %FrameRate% empty: fallback %FrameRate_Nominal%
    global MediaInfoFramecount = fc>0 ? fc : nof>0 ? nof : round(MediaInfoFramerate * duration / 1000) #if %FrameCount% empty: 
        \ fallback %NumberOfFrames% 2nd fallback Video;%Duration%
    global MediaInfoFramecount = (MediaInfoFramecount > 999999) ? round(MediaInfoFramecount/1000) : 
        \ MediaInfoFramecount #Framecount over 1 million is MediaInfo bug
    global MediaInfoPAR = (PAR == 0.843000) ? 1.183000 : PAR #MediaInfo bug
    
    GScript(""" #"
        if (MediaInfoFrameCount == 0) {
            #Framecount still empty: fallback Duration*Framerate
            sCommand = "CMD /C CHCP 1252 && MediaInfo --Output=General;duration=0%Duration% " + RT_QuoteStr(s) + " >" + RT_QuoteStr(sFile)
            CallCmd(BlankClip, Open=sCommand, Hide=true, debug=false, Synchronous=7)
            Import(sFile)
            RT_FileDelete(sFile)
            RT_DebugF("duration for %s = %i", s, duration, name="GetMediaInfo")
            if (duration != 0) { global MediaInfoFramecount = round(MediaInfoFramerate * duration / 1000) }
        }
    """) #"
    assert(MediaInfoFramecount != 0 && MediaInfoFramerate != 0 && MediaInfoPAR != 0, "MediaInfo incomplete data '" 
          \ +string(MediaInfoFramecount)+"'"+string(MediaInfoFramerate)+"'"+string(MediaInfoPAR)+"'")
    # Select: 0=FrameCount, 1=FrameRate, 2=PAR
    RT_DebugF("FPS=%f Framecount=%d PAR=%f", MediaInfoFrameRate, MediaInfoFrameCount, MediaInfoPAR, name="GetMediaInfo")
}
EDIT:
Quote:
Remainder were I think chosen based on mixture of color counts, dithering mixture result when mixed with already chosen colors,
Actually, I think stuff in blue was actually choosing colors most distant (RGB color cube) to those already chosen, which more or less amounts to the same thing.

EDIT: And something I was playing with to extract numeric Int single data item only.

Code:
        Function GetMediaInfoItem(String Section,String Item,String VidFn,Bool "Debug",Bool "DelOutputFile") {
            # Returns with output filename in string, or Int(-1) on error.
            myName="GetMediaInfoItem: "     DelOutputFile=Default(DelOutputFile,True)   Debug=Default(Debug,False)
            ret = -1
            if(!RT_VarExist("DB_SpliceOpenClip_MEDIAINFO_UNAVALABLE")) {
                VidFn=RT_GetFullPathName(VidFn)            
                LogFn=RT_GetFullPathName("MediaInfo_"+RT_LocalTimeString(File=true)+".txt")        # Unique-ish filename, full path
                MiCmd="MediaInfo.Exe --LogFile="+Chr(34)+LogFn+Chr(34)+" " + 
                    \ "--Inform="+Section+";" + "%"+Item+"% " + Chr(34) + VidFn + Chr(34) + " "
                RT_FileDelete(LogFn)                                                # Delete output file prior to Call (Unlikely to ever Exist)    
                CallCmd(BlankClip(Length=1), Open=MiCmd, Hide=true, debug=Debug, Synchronous=1)   # Call the command, wait command terminated.
                if(Exist(Logfn)){ 
                    Ret=RT_ReadTxtFromFile(LogFn).RT_TxtGetLine
                    (Debug) ? RT_DebugF("MediaInfo::%s;%%%s%% = '%s'",Section,Item,Ret,name=myName) : NOP
                    (DelOutputFile) ? RT_FileDelete(LogFn) : NOP
                } else { 
                    (DEBUG) ? RT_DebugF("%s FAILED",MiCmd,name=myName) : NOP
                    Global DB_SpliceOpenClip_MEDIAINFO_UNAVALABLE=True 
                }
            }
            return Ret
        }
        Function GetMediaInfoItemNumber(String Section,String Item,String VidFn,Bool "Debug",Bool "DelOutputFile") {
            Ret = GetMediaInfoItem(Section,Item,VidFn,Debug=Debug,DelOutputFile=DelOutputFile)
            Return (Ret.IsString) ? RT_NumberValue(Ret) : Ret
        }
Code:
AudioCount=GetMediaInfoItemNumber("General","AudioCount",FN,Debug=Debug)
You will likely want path to MediaInfo in your Path environment variable (I use C:\BIN\).

EDIT: something like this could be used for Float item result (untested)
Code:
Function GetMediaInfoItemFloat(String Section,String Item,String VidFn,Bool "Debug",Bool "DelOutputFile") {
            Ret = GetMediaInfoItem(Section,Item,VidFn,Debug=Debug,DelOutputFile=DelOutputFile)
            Return (Ret.IsString) ? Value(Ret) : Ret
}
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th March 2017 at 15:53.
StainlessS is offline   Reply With Quote
Old 4th March 2017, 18:43   #11  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Yes, I thought about 4 bits ($FFF = 16*16*16 = 4096 colors). Aim is to get something like this:



with two palettes for the actual frame, and two for the whole clip (that should be analyzed once, and stored in a file, I suppose); one for the most used colors sorted by importance, and the other sorted from black to white.


Mediainfo: I took a look at your thread, wow... I think I should study it (a lot) to try to understand something!

A different approach - simpler for my small mind, but should work, and it could be used by anyone who have just avisynth installed, with no additional plugin - is to create an "avisynth" template on Mediainfo, so when I visualize data on it, I should just copy & paste the result into an avisynth script, and variables would be ready there, something like

Code:
Pixel_Aspect_Ratio="%PixelAspectRatio%\r\n"
Display_Aspect_Ratio="%DisplayAspectRatio%\r\n"
and so on, so I could implement them in carefully placed subtitles.

What do you think?

Thanks in advance for your patience, I know you need it a lot with me...

spoRv is offline   Reply With Quote
Old 4th March 2017, 19:56   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
There is some kind of template mode in that thread, Martin53 created template (in given snippet) that can be used in an Eval().

I've done mod,wanna give it a test drive ?

Added Args x,y,w,h (area in question), Mask (planar), MaskMin, MaskMax, where Mask given and Luma pixels in mask between MaskMin, MaskMax then gives count only on those. Also Int msb most significant bits. Seems to be working OK.
Good idea to test return value of the function to detect 0 pixels detected (have to be in x,y,w,h and mask valid, otherwise 0 count returned).


Oh, I have not done any rounding (up or down scale). Think there was a thread in devs somewhere on rounding and such,
dont know what was decided as being best, so I've just converted eg $FF -> $F, and $F back up to $F0. Easily changed if
anybody can point to better method.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th March 2017 at 20:14.
StainlessS is offline   Reply With Quote
Old 4th March 2017, 22:48   #13  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Test drive? Sure!
spoRv is offline   Reply With Quote
Old 5th March 2017, 11:13   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Script to show all colors in a frame
Code:
Global  Cnt_Color_Fld     = 0
Global  Cnt_Count_Fld     = 1
Global  ColorsPerFrame    = 10                # Max 16
DB1      = "RGB_COUNT1.DB"
DB2      = "RGB_COUNT2.DB"
DB3      = "RGB_COUNT3.DB"
FRAME=19733
MSB1=3
MSB2=4
MSB3=5
Avisource("f:\v\jurassicPark.Avi").ConvertToRGB32.Trim(FRAME,-1).KillAudio
RoboCrop
###
ORG=Last
###
A=Doit(DB1,Last,MSB1).BilinearResize(ORG.Width,Org.Height)
B=Doit(DB2,Last,MSB2).BilinearResize(ORG.Width,Org.Height)
C=Doit(DB3,Last,MSB3).BilinearResize(ORG.Width,Org.Height)
###
LFT=StackVertical(ORG,A)
RGT=StackVertical(B,C)
StackHorizontal(LFT,RGT)
Return last.AssumeFps(1.0)

Function Doit(String DB,clip c,Int msb) {
    c
    RT_DBaseRgbColorCount(DB,Last,0,msb=MSB)                                 # Count colors of frame 0 (originally FRAME).
    RT_DBaseQuickSort(DB,Field=Cnt_Count_Fld,Field2=Cnt_Color_Fld,Ascend=False)  # Sort Descending (biggest count at record 0)
    ShowFrameColorsRGB(DB,ColorsPerFrame)
}

Function ShowFrameColorsRGB(String DB,Int "ColorsPerFrame") {
    myName="ShowFrameColorsRGB: "
    ColorsPerFrame=Default(ColorsPerFrame,10)
    Assert(DB!="" && Exist(DB),RT_String("%s DB is empty string or does not exist",myName))
    Assert(ColorsPerFrame>=1&&ColorsPerFrame<=16,RT_String("%s 1 <= ColorsPerFrame <=16 (%d)",myName,ColorsPerFrame))
    DB=RT_GetFullPathName(DB)        
    FuncS="""
        Function QRecDat@@@(String DB,int n) {
            RGB     = RT_DBaseGetField(DB,n,Cnt_Color_Fld)
            COL     = T@@@.BlankClip(color=RGB).LetterBox(2,2,2,2)
            ORD     = T@@@.BlankClip(color=$FFFFFF).Subtitle(RT_String("%d/%d",n+1,RECORDS@@@),Align=5).LetterBox(2,2,2,2)
            CNT     = T@@@.BlankClip(color=$FFFFFF).Subtitle(RT_String("%d",RT_DBaseGetField(DB,n,Cnt_Count_Fld)),Align=5).LetterBox(2,2,2,2)
            RGBC    = T@@@.BlankClip(color=$FFFFFF).Subtitle(RT_String("$%06X",RGB),Align=5).LetterBox(2,2,2,2)
            Return StackHorizontal(COL,ORD,CNT,RGBC)        
        }
        Function Fn@@@(clip dummy,String DB,int cpf) {
            n       = current_frame
            SRec    = n * cpf
            Last    = HEAD@@@
            for(i=0,cpf-1) {
                Q = (SRec+i < RECORDS@@@) ? qRecDat@@@(DB,SRec+i) : BAR@@@
                StackVertical(Last,Q)
            }
            Return Last
        }
        H=48
        #######################################
        Global RECORDS@@@    = RT_DBaseRecords(DB)
        Global T@@@ = BlankClip(length=1,width=128,height=H,pixel_type="RGB32").KillAudio 
        COL            = T@@@.BlankClip(color=$FFFFFF).Subtitle("Color",Align=5).LetterBox(2,2,2,2)
        ORD            = T@@@.BlankClip(color=$FFFFFF).Subtitle("Order",Align=5).LetterBox(2,2,2,2)
        CNT            = T@@@.BlankClip(color=$FFFFFF).Subtitle("Count",Align=5).LetterBox(2,2,2,2)
        RGBC           = T@@@.BlankClip(color=$FFFFFF).Subtitle("RGB",Align=5).LetterBox(2,2,2,2)
        Global HEAD@@@ = StackHorizontal(COL,ORD,CNT,RGBC)
        Global BAR@@@  = HEAD@@@.BlankClip
        Global BLK@@@  = BAR@@@.BlankClip(Height=ColorsPerFrame*H)
        Global HEAD@@@ = HEAD@@@.LetterBox(0,8,0,0)
        Pages = (RECORDS@@@ + ColorsPerFrame - 1) / ColorsPerFrame  
        StackVertical(HEAD@@@,BLK@@@).BlankClip.Loop(Pages,0,0)
        #######################################
        ARGS = "DB,ColorsPerFrame"
        Last.GScriptClip("Fn@@@("+ARGS+")", local=true, args=ARGS)
    """
    GIFunc ="ShowFrameColorsRGB"       # Function Name, Supply unique name for your multi-instance function.
    GIName =GIFunc+"_InstanceNumber"   # Name of the Instance number Global
    RT_IncrGlobal(GIName)              # Increment Instance Global (init to 1 if not already exists)
    GID    = GIFunc + "_" + String(Eval(GIName))
    InstS = RT_StrReplace(FuncS,"@@@","_"+GID)
#   RT_WriteFile("DEBUG_"+GID+".TXT","%s",InstS)
    Return GScript(InstS)
}
Here @ Most Significant Bits=8(all colors), for single source movie (Jurassic Park) frame totalling about 84,000 colors,
creates sequence of about 8400 output frames showing 10 colors per frame, just imagine how much fun
you could have viewing all of the colors of the other 200,000 frames in the movie, could keep you busy all day.



EDIT: Changed to MultiInstance script showing 3 version of MSB.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 15th July 2017 at 16:41.
StainlessS is offline   Reply With Quote
Old 6th March 2017, 00:28   #15  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Away from PC, I would try it ASAP. What dependencies are needed?

Jurassic Park: at the end, the palette for the whole movie is... made of some sort of navy blue shades? That's strange... or that's only for those 8400 frames?
spoRv is offline   Reply With Quote
Old 6th March 2017, 05:11   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
What dependencies are needed?
RT_Stats latest (v2 beta 9).
RoboCrop, unless you want to count black pixels in border (quite a few in Jurassic park DVD).
GScript, and Grunt.

I changed sort order to most common pixels 1st in list, ie first frame.
Count shows total pixel count for that color.
You would probably not want to view MSB=8, just not much use. The image you chose (kids outside store) does not
really seem to have much variation of color in it
and so you could select similar colors to your selection quite easily by hand, Jurassic park frame chosen has a myriad of
totally different colors and I would not know where to start to pick out a dozen.
The modded 3X script shows MSB=3, =4, and =5, ie RGB color cube chopped up into smaller cubes, ie
MSB==3=512 cubes(8x8x8), MSB==4=4096 cubes(16*16*16), MSB==5=32768 cubes(32*32*32), first colors in output colors list
are highest pixel count in those smaller cubes.
Frame lists show Color, Order in list (EDIT: Together with total number of colors in list), pixel count, and Hex RGB.

I'm still not sure what it is you want to achieve, conversion to limited color count image format eg GIF ?
I dont really get the purpose for the palette selection, nor the whole movie FingerPrint thing,
what use is it ?

Also, is there a specific number of colors required in palette ?
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 6th March 2017 at 06:04.
StainlessS is offline   Reply With Quote
Old 6th March 2017, 05:56   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Your kids outside store image with MSB=3



EDIT: In actual fact there are more colors in your kids outside store pic, its just that they are nearly all the same.
MSB=8, ie 16 millions colors (148000 unique colors, as opposed to Jurassic park image 84000, but your pic is much bigger)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 15th July 2017 at 16:43.
StainlessS is offline   Reply With Quote
Old 6th March 2017, 12:02   #18  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
The aim of a movie fingerprint is to get an unique ID for any movie version - talking about Jurassic Park, an ID for JP on BD, on DVD, on 3D BD - that would be useful to spot differences in color grading - they are all different, but for example the US BD could be the same of EU BD, for example.

So the moviebarcode is an interesting way of representing a whole movie in a single image, like the following (Aliens, top BD, bottom LD):



a wonderful thing would be to find the way to sort those bars from darker (#000000) to brighter (#FFFFFF).

But I would add also few frames from the movie, with a related palette, and a palette of the whole film.

The fact is, I have not a clear idea of how to get the "right" palette out of a frame... I thought about most used colors, don't know if it's the best, though!

Another idea: it would be great also to have a graph of the scene changes, like alternate black and white bars - that, with 1280 pixels, the sample would be less than two seconds, sufficient for almost all the movies, apart the fastets.
Or, a "movement" graph...

What do you think about these ideas? I know there are similar attempts, but none - apart moviebarcolor - made using avisynth AFAIK.
spoRv is offline   Reply With Quote
Old 6th March 2017, 16:53   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, I can see that it could have use to be able to tell if two films are dissimilar via the Fingerprint thing.
But not sure that anything could be gotten from any palette, if two films are
already known to be different via your fingerprint, comparing palettes may be akin to comparing apples
with pomegranates with inevitable secondary dissimilar result that could probably have been foretold from the first.

I can tell from above, that the BD is dark and dismal, and that the DVD is bright and sparkly,
glad I never got around to getting a BD

EDIT:
Quote:
I thought about most used colors, don't know if it's the best, though!
Max unique color count for Jurassic park was 213, and for kids frame was 12420, the pomegranates thing again.
Max color count is probably not good idea (at least on its own), comparing supposed exact same frames might
bring results closer together but dissimilarities in grading would produce random differences likely resulting in
different palette being chosen making differences even greater.
I may have a try at extracting some kind of palette information from maximum count in localised area, but I may well be
wasting my time completely. You though, have to decide how many colors are required, and what to do in say instance
where frame is nearly single color (only nearly only two colors, etc).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 6th March 2017 at 17:26.
StainlessS is offline   Reply With Quote
Old 7th March 2017, 05:29   #20  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Let's try to use the moviebarcode as source for the palette.
So, reduce the colors from 24bit to 6bit (possibly rounding the similar ones to the ones most used) get a limited palette of 64 colors; now, extract the X most used colors (variable from, let's say, 4 to 16?) and have those two series of variables, one sort by most used, and one sort from darkest to brightest.

This should be simpler to obtain, I hope!

Really, I don't want you getting crazy to make this function; if you feel you would do it, take all the time you need!

Again, thanks for all your efforts!
spoRv is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.