Skip to content

Watermark AI-generated image files #56102

Description

@julien-nc

@nextcloud/integration

We could watermark all the images generated by the task processing providers. If we do it at the task processing level, it saves us the effort of implementing it in all providers.

  • Visible watermark: We could insert a little image (logo + text) in a corner of images. Something like the assistant logo and a label like "AI-generated"
  • Invisible watermark
    • We can store information as EXIF data. We could store a comment. We might be able to use the Php imagemagick extension or the GD one. It would better than using lsolesen/pel which is abandonned.
    • There might be a way to embed something invisible in the image itself. For example: https://github.com/SebaOfficial/Steganography

This could be done right before storing the images in appdata, when the task results are set by the provider.

For context: the watermarking is a requirement for the AI act, even if it can easily be erased we have to implement it to the best of our abilities. If there is an easy method to make an invisible watermark, we have to do it, and if it is not realistic a simpler method like EXIF / ID3 is likely sufficient.

Activity

  1. added this to the Nextcloud 33 milestone on Oct 30, 2025
  2. marcelklehr commented on Oct 30, 2025

    @marcelklehr
    Member

    At the moment it is not clear from the docs or the namíng that the TaskProcessing API should only be used to produce AI-generated files. I would suggest to decide whether we want to restrict the APIs usage to AI only, if it turns out that we want that, we can add the watermarking to the server, otherwise, I think it would be better to have it in the individual apps.

  3. oleksandr-nc commented on Oct 30, 2025

    @oleksandr-nc
    Contributor

    How about implementing this as an additional flag? If the watermark=True flag is set, then TaskProcessing will add a watermark. If watermark=False, then it won't.
    Apps should decide for themselves whether to set the flag or not (they will only want to set it at the final stage, and in a chain-of-tasks it will be False at all preceding stages).

  4. EntityinArray commented on Oct 31, 2025

    @EntityinArray

    IMO, "invisible" watermarking is a bad idea, it can easily be erased and will just malform data in unexpected ways
    How would people even verify these watermarks if they are invisible?

    Adding a friendly comment into EXIF or ID3 is fine
    And even then, i think its out of scope for NC, processing tools should leave these comments themselves.

  5. DaphneMuller commented on Oct 31, 2025

    @DaphneMuller
    Contributor

    Just to be clear, it is not out of scope for Nextcloud, the watermarking is a requirement for the AI act, even if it can easily be erased we have to implement it to the best of our abilities. If there is an easy method to make an invisible watermark, we have to do it as per law and in that case EXIF / ID3 is not sufficient.

    In what way would it malform data in unexpected ways? Do you have a concrete example?

  6. julien-nc commented on Oct 31, 2025

    @julien-nc
    MemberAuthor

    We could use steganography. There are Php libraries for that like https://github.com/SebaOfficial/Steganography . It does not seem too hard to implement that with any library: https://thedebuggers.com/image-steganography-hiding-text-using-php/

  7. EntityinArray commented on Oct 31, 2025

    @EntityinArray

    In what way would it malform data in unexpected ways? Do you have a concrete example?

    Say the AI tools itself adds a watermark, then nextcloud adds its watermark, then tool that requested the image from nextcloud adds a watermark and it turns into a mess

    I think watermarking should only be handled at the source (in the AI image generating tool itself)
    Nextcloud doesn't generate any AI content by itself, so I think you guys are safe from this law (i'm not a lawyer though)

  8. marcelklehr commented on Nov 11, 2025

    @marcelklehr
    Member

    Nextcloud doesn't generate any AI content by itself, so I think you guys are safe from this law (i'm not a lawyer though)

    We do have apps in our portfolio that generate AI content and we need to make sure that our customers are not liable via this law.

    From this conversation I would say it would be best if we add the watermarks in the exapps and integration_openai.

  9. marcelklehr commented on Nov 11, 2025

    @marcelklehr
    Member

    FYI, these are the legal texts:

    Providers of AI systems, including general-purpose AI systems, generating synthetic audio, image, video or text content, shall ensure that the outputs of the AI system are marked in a machine-readable format and detectable as artificially generated or manipulated. Providers shall ensure their technical solutions are effective, interoperable, robust and reliable as far as this is technically feasible, taking into account the specificities and limitations of various types of content, the costs of implementation and the generally acknowledged state of the art, as may be reflected in relevant technical standards.
    AI Act - Article 50

    Such techniques and methods should be sufficiently reliable, interoperable, effective and robust as far as this is technically feasible, taking into account available techniques or a combination of such techniques, such as watermarks, metadata identifications, cryptographic methods for proving provenance and authenticity of content, logging methods, fingerprints or other techniques, as may be appropriate. When implementing this obligation, providers should also take into account the specificities and the limitations of the different types of content and the relevant technological and market developments in the field, as reflected in the generally acknowledged state of the art.
    AI Act - Recital 133

    The generally acknowledged state of the art, in my opinion, is that here is no standard (let alone an open standard) for making AI-generated images robustly and reliably detectable. Only Google has an implementation called SynthID, which is proprietary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions