I'm trying to watermark images in java using "ImageMagic's" shell command, passing it java's process builder. This is successfully generating the watermarked image and the output image is getting stored in my repository from where I'm doing the further processing.
But I need to implement a workflow in which I take the images as input, watermark them and without storing the watermarked output, I need to stream the images as output on the webpage, so is there a way by which I can make the watermarked output displayable on webpage; basically by collecting the output response from imagemagick and doing the further processing using java (which I'm aware of), but the important thing is if it's possible to collect the watermarked output as response from ImageMagick without storing it.
Any help on this would be held in high regards.
Thanks
Watermark Images in java using ImageMagick
-
- Posts: 15
- Joined: 2019-03-05T22:47:03-07:00
- Authentication code: 1152
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Watermark Images in java using ImageMagick
Can't you just pipe the results in PNG format by using the output as PNG:- | ...
-
- Posts: 15
- Joined: 2019-03-05T22:47:03-07:00
- Authentication code: 1152
Re: Watermark Images in java using ImageMagick
@fmw42 if we pipe the output, is it something that we do not require to store the output file in the repository?
If so can you please explain this with an example
If so can you please explain this with an example
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Watermark Images in java using ImageMagick
If you are using command line or API, I believe you can produce an image in say PNG format and pipe it to your other processing.
convert image1 image2 -geometry +X+Y -gravity Z -compose over -composite PNG:- | <your other processing using - as the input>
The PNG:- generates a PNG format image that is piped without saving to disk as stdout and received as stdin for your other processing.
convert image1 image2 -geometry +X+Y -gravity Z -compose over -composite PNG:- | <your other processing using - as the input>
The PNG:- generates a PNG format image that is piped without saving to disk as stdout and received as stdin for your other processing.
-
- Posts: 15
- Joined: 2019-03-05T22:47:03-07:00
- Authentication code: 1152
Re: Watermark Images in java using ImageMagick
Hi @fmw42,
Thanks for your kind help, will look more into the piping feature of ImageMagick and will check how can I integrate it with my requirement. Once again, thanks for the help like always
Thanks for your kind help, will look more into the piping feature of ImageMagick and will check how can I integrate it with my requirement. Once again, thanks for the help like always