Background
I have an SQL database table set-up on "SQLite" with over 100,000 colour codes stored in the form of colour space parameters L, a, b
(https://en.wikipedia.org/wiki/Lab_color_space).
Task at hand:
We want to match a randomly chosen colour (L_rand, a_rand and b_rand
) to the closest colour in this large database.
The way we want to achieve this would be to use the Delta E CIE 2000 for calculating the difference between the randomly chosen colour and the database of colours. We would like to implement this calculation strategy into SQL (already implemented and shared by @Jaza previously) and there has been a discussion about this already in one of the posts (Performance of Delta E (CIE Lab) calculating and sorting in SQL) mainly by @Jaza and @hruske before.
Question:
Referring to the Best, but advanced solution section of @hruske 's post: Could you provide some hints on how can we implement the Delta E queries as K-Nearest-Neighbor searches with a custom GiST index? In other words, how can I use btree-gist PostGRE SQL extension I apologise as I am a novice in SQL and I wanted a direction to work with.
Thanks in advance.