Description:
This PR brings three major improvements to the current code:
Correction of Local File Path Reading: The existing implementation had issues with the path reading of local files. This PR addresses this by ensuring correct handling and interpretation of local file paths, thus preventing any discrepancies caused by incorrect directory navigation.
Support for Mask File Upload: The PR extends the application's functionality by introducing the ability to handle mask files uploaded as base64 strings. Previously, mask files could only be read from the local file system. Now, users can upload masks directly to the application, providing them with greater flexibility and ease of use.
Support for Similar Color Filtering: A key enhancement in this PR is the addition of a color filtering mechanism that effectively discards colors that are very close to each other when interpreting masks. This prevents the generation of separate masks for colors that are visually indistinguishable, leading to more meaningful and manageable mask sets.
Changed basedir path so that it yields the extension's directory -
importing scripts from modules returns the root instead of extension.
Also added a fallback which uses scripts_path in case first option is
inaccessible.
Added some stuff to region masks: Upload (via a different component due
to bug), preset save and load, -1 region to clear areas.