# Create an image watermark using sharp composite transformation in Directus image preset

**URL:** https://community.directus.com/t/create-an-image-watermark-using-sharp-composite-transformation-in-directus-image-preset/209
**Category:** Help
**Created:** [May 2, 2025, 1:30am UTC](https://community.directus.com/t/create-an-image-watermark-using-sharp-composite-transformation-in-directus-image-preset/209 "2025-05-02T01:30:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JayShoe](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/jayshoe/32/126_2.png) [@JayShoe](https://community.directus.com/u/JayShoe)
#### Post date: [May 2, 2025, 1:30am UTC](https://community.directus.com/t/create-an-image-watermark-using-sharp-composite-transformation-in-directus-image-preset/209/1 "2025-05-02T01:30:19Z")

</div>

Hello,

I found this code in a discussion on github from [johnny9144](https://github.com/johnny9144)- [here](https://github.com/directus/directus/discussions/4208#discussioncomment-7627417):

> Share a workaround approach to add watermark inspired by the Sharp composite function rijkvanzanten mentioned above, the solution isn’t perfect but works as intended.
> 
> Steps
> 
> Prepare a watermark-only image PNG file and put it in a space (In my case, I pack it into Directus docker image together) that the Directus server be able to access.
> 
> Go to the project settings page and add a new transformation preset with additional transformation as below (remember to replace the file-system-absolute-path-to-watermark-file with yours.)
> 
> update: relative path works as well
> 
> [  
> [  
> “composite”,  
> [  
> {  
> “input”: \<file-system-absolute-path-to-watermark-file\>,  
> “tile”: true  
> }  
> ]  
> ]  
> ]  
> After applying the project settings(you have to apply project settings after you add a new preset), you can get a new image with watermark via the endpoint /assets//?key= or /assets/?key=.  
> Hope that helps anyone who finds the discussion. It works so far so good at the moment on Directus 10.6.3.

But try this transformation code, I get an error that the file is missing. But that URL does reach the right watermark file.

```auto
{"errors":[{"message":"Input file is missing: \"https://mysite.com/assets/f5b4b673-97dd-4325-b885-44bfcf014c31\"","extensions":{"code":"INTERNAL_SERVER_ERROR"}}]}

```

Any suggestions on what I can do to make sure the image can be found?

---

<div class="post-metadata">

### Author: ![brainslug](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/brainslug/32/35_2.png) [@brainslug](https://community.directus.com/u/brainslug)
#### Post date: [May 2, 2025, 3:48pm UTC](https://community.directus.com/t/create-an-image-watermark-using-sharp-composite-transformation-in-directus-image-preset/209/2 "2025-05-02T15:48:59Z")

</div>

Make sure `<file-system-absolute-path-to-watermark-file>` is a local file path, sharp will probably not download that for you.
