xRyul / obsidian-image-converter

⚡️ Convert and compress images from one format to another by drag'n'dropping or pasting files into the note. HEIC, TIF, JPG, WEBP, PNG.
MIT License
175 stars 15 forks source link

Annotated images (version 1.2.7) are always in PNG? #94

Open juanbretti opened 22 hours ago

juanbretti commented 22 hours ago

Hello, Quick question.

When annotating an image, is the file always saved as PNG? Even when the original was JPEG, and the actual filename has extension .jpg I do understand you are trying to preserve transparency. That's why you are using PNG?

Thank you! Great idea to have a quick annotation tool!

image

SYSTEM INFO:
    Obsidian version: v1.7.7
    Installer version: v1.7.7
    Operating system: Windows 11 Pro 10.0.22631
    Login status: logged in
    Language: en
    Catalyst license: insider
    Insider build toggle: on
    Live preview: on
    Base theme: dark
    Community theme: none
    Snippets enabled: 4
    Restricted mode: off
    Plugins installed: 18
    Plugins enabled: 18
        1: Text Format v3.1.0
        2: Templater v2.9.1
        3: Dataview v0.5.67
        4: Calendar v1.5.10
        5: Settings Search v1.3.10
        6: Homepage v4.0.7
        7: Text Extractor v0.5.2
        8: Omnisearch v1.25.1
        9: Natural Language Dates v0.6.2
        10: Excalidraw v2.6.7
        11: Git v2.28.2
        12: Tag Wrangler v0.6.1
        13: Tasks v7.13.0
        14: Enhancing Export v1.10.9
        15: CSV Codeblock v1.1.0
        16: Mind Map v1.1.0
        17: Plugin Update Tracker v1.6.0
        18: Image Converter v1.2.7
xRyul commented 20 hours ago

Another option is to have WEBP embedded into formats which do not offer transparency. This technically would lower the file size too. However, it might break previews and thumbnails on some setups. Thus, PNG was the safest.

Or embed PNG into PNG, WEBP into WEBP etc. and then JPG/JPEG would have white or black background. But this makes it much harder to deal with different color schemes e.g.: when flattening. Thus again, in this case PNG is simply more universal too.

If you would like to play around with it:

juanbretti commented 9 hours ago

@xRyul , you have very good points. I agree with you that PNG is the safest way to keep transparency. For that scenario, maybe I would recommend renaming the file extension to .png, so it is clear for the user.

Another solution could be to add a feature to remove transparency (set a solid background). You might need to consider settings for:

By the way, this annotations is a very cool feature for this plugin.