TheAcharya / MarkerData

The avant-garde Marker extraction application crafted for Final Cut Pro
https://markerdata.theacharya.co
MIT License
27 stars 1 forks source link

Update Colour Swatch #72

Closed IAmVigneswaran closed 4 months ago

IAmVigneswaran commented 5 months ago

@DenDmitriev You can update us with relevant code on how to arrange the colours from darkest to the lightest.

Thank you.

IAmVigneswaran commented 5 months ago

@milanvarady Denis have updated DominantColors to 1.1.2 with has new improvements.

https://github.com/DenDmitriev/DominantColors/tree/update-algoritm

We can hard code the following.

`quality: .best`
`sorting: .darkness`

Add Exclude Grey Option.

DenDmitriev commented 5 months ago

Hello I'm done with updating the algorithms. Current version is 1.1.3. Use her code.

I added extraction quality. To get the most accurate results, you need to use DominantColorQuality.best. To speed things up, you can switch to .high or .fair. They use pixelation of the image and give good results and operating time. Added sorting options by quantity (DominantColors.Sort.frequency) and brightness (.darkness, .lightness).

The update to the algorithm is that colors are now sorted by shade based on wavelength (or color wheel) so as not to miss parts with a small amount of color on image. This made it possible to get, for example, a red cap in the image, which was not possible before.

Снимок экрана 2024-05-02 в 09 55 26

Also now the colors should be the same every time.

IAmVigneswaran commented 5 months ago

@DenDmitriev Thanks for the insights!

IAmVigneswaran commented 5 months ago

@milanvarady After much thought, I think it is best we update the colour Swatch in 1.0.0.

If we were to do it post release, users might have incompatible configuration files and inconsistent colour swatch between versions.

MacOSPreview.app.zip

I have complied the Test MacOSPreview app.

milanvarady commented 5 months ago

@IAmVigneswaran I have updated the Marker Data code for DominantColors v1.1.4.

milanvarady commented 5 months ago

With the palette quality set to best, it takes a lot of time to calculate the colors, up to 30+ seconds. I suggest using the high setting which takes around 3-4 seconds. Visually I hardly see any real difference. (Or we can go even lower, the fair option takes 1-1.5 seconds)

IAmVigneswaran commented 5 months ago

With the palette quality set to best, it takes a lot of time to calculate the colors, up to 30+ seconds. I suggest using the high setting which takes around 3-4 seconds. Visually I hardly see any real difference. (Or we can go even lower, the fair option takes 1-1.5 seconds)

In that case, We have dropdown called Accuracy after Algorithm. We set the default to High. Users can set to Best if they desire.

We also set the set the sorting to darkness. We can hard code this. That way all users would have a unified presentation.

IAmVigneswaran commented 5 months ago

@milanvarady When processing swatch, is it possible to Mention Analysing Swatch with progress bar, that way the users is aware of the stage. That way the users will be more cautious when setting the Accuracy.

Main-Extract
IAmVigneswaran commented 5 months ago

@DenDmitriev Could you release DominantColors to 1.1.4 with new PR from Milan. Thank you. 🙏

DenDmitriev commented 5 months ago

Yes. Use version 1.1.5. 😉

milanvarady commented 5 months ago

I have merged the swatch changes. We now have the accuracy option, the swatch progress is shown on the UI, and the sorting is hard coded to be based on color darkness.

IAmVigneswaran commented 5 months ago

@milanvarady Thanks for making the tweaks!

Progress-Swatch

Looks really nice!

add-exclude-grey

We also need to add Exclude Grey Option. We can add it after Exclude Black.


@DenDmitriev I notice that both CIE94 and CIEDE2000 gives the same colour strip. Is that anything wrong with our code?

swatch-CIE94

swatch-CIEDE2000

DenDmitriev commented 5 months ago

Hello

I noticed it too, probably the calculation gives the same color difference between CIE94 and CIEDE2000. I'll recheck it at the next update.

milanvarady commented 5 months ago

We also need to add Exclude Grey Option.

Added.

IAmVigneswaran commented 5 months ago

@DenDmitriev

I noticed it too, probably the calculation gives the same color difference between CIE94 and CIEDE2000. I'll recheck it at the next update.

If the algorithm and math is different for both CIE94 and CIEDE2000 shouldn't it produce a different result?

Hopefully this can be fix in the next update of DominantColors.

Thank you.

DenDmitriev commented 5 months ago

Mathematics is different, but I probably made a mistake in the test or in the algorithm itself. I'll check it over.

IAmVigneswaran commented 5 months ago

Mathematics is different, but I probably made a mistake in the test or in the algorithm itself. I'll check it over.

Thank you! 🙏

DenDmitriev commented 4 months ago

I found an error. I inadvertively sent values in degrees instead of radians to the functions cos, sin. Now I have created tests with a reference comparison of the results and they were successful. New version 1.1.6.

IAmVigneswaran commented 4 months ago

@DenDmitriev I have created a new build of Marker Data using DominantColors 1.1.6.

Are these suppose to be the expected results? I notice that CMC now produces more colour segments.

Thank you.

Euclidean

CIE76

CIE94

CIEDE2000

CMC

DenDmitriev commented 4 months ago

I wrote tests for each dE algorithms and they coincide with the reference ones. I also corrected the formulas in SMS and that's why it's also different now.

IAmVigneswaran commented 4 months ago

I wrote tests for each dE algorithms and they coincide with the reference ones. I also corrected the formulas in SMS and that's why it's also different now.

Thank you for fixing and improving the library!

IAmVigneswaran commented 4 months ago

@DenDmitriev Thanks for releasing 1.1.7

I am little confused about UIColor, NSColor and Color.Resolved.

You mentioned, you added the ability to call Color.Resolved, NSColor or UIColor from NSImage or UIImage at once.

What does it do?

Do we need to tweak our code for Marker Data?

Thanks.

DenDmitriev commented 4 months ago

Past API calls work, no changes. Added convenient options to additionally get UIColor by UIImage, NSColor by NSImage.

Дмитриев Денис https://dendmitriev.ru https://www.facebook.com/denis.dmitriev.714

Сб, 11 мая 2024 г. в 13:18, Vigneswaran Rajkumar @.***>:

@DenDmitriev https://github.com/DenDmitriev Thanks for releasing 1.1.7

I am little confused about UIColor, NSColor and Color.Resolved.

You mentioned, you added the ability to call Color.Resolved, NSColor or UIColor from NSImage or UIImage at once.

What does it do?

Do we need to tweak our code for Marker Data?

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/TheAcharya/MarkerData/issues/72#issuecomment-2105664887, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRL6Q5XPUY4EYX3UBHRNBDZBXV6DAVCNFSM6AAAAABGYCNTP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGY3DIOBYG4 . You are receiving this because you were mentioned.Message ID: @.***>