I have 2 type of images.
Some hundreds of png images with just one color(gray) and some transparent zones then must be transparent even in final result.
Over 30 thousands of jpg images with many size. I must estrapolate from jpg images the gray zones of png files.
Now i use something like this :
convert JPG_FILE.jpg -resize WIDTH_OF_PNGxHEIGHT_OF_PNG^ -gravity Center -crop WIDTH_OF_PNGxHEIGHT_OF_PNG+0+0 -alpha Set PNG_FILE.png ( -clone 0,1 -alpha Opaque -compose Hardlight -composite ) -delete 0 -compose In -composite RESULT_IMAGE.png
it works very good but its a bit slow
any suggestion for faster execution?
compose one transparent png(as mask) with one jpg
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: compose one transparent png(as mask) with one jpg
What version of IM, on what platform? Can you link to sample input and output images?
Perhaps your IM is Q16 HDRI but your requirement needs only Q8 non-integer.
Perhaps your IM is Q16 HDRI but your requirement needs only Q8 non-integer.
snibgo's IM pages: im.snibgo.com
Re: compose one transparent png(as mask) with one jpg
i post some example not with real image, i cant .... these are not mine
but the result image dosent show pretty any Hard Light effect then i need in real application because the images are very small
the real masks(png) are around 1200x3000 px and jpg images are even bigger, this help to show lot better the little but nice Hard Light effect on the borders
jpeg example
mask example
result example
this is what i used
convert jpeg_example.jpg -resize 300x500^ -gravity Center -crop 300x500+0+0 -alpha Set mask_example.png \( -clone 0,1 -alpha Opaque -compose Hardlight -composite \) -delete 0 -compose In -composite result.png
the blue line at end are just an error of miniatures, my images are fine
but the result image dosent show pretty any Hard Light effect then i need in real application because the images are very small
the real masks(png) are around 1200x3000 px and jpg images are even bigger, this help to show lot better the little but nice Hard Light effect on the borders
jpeg example
mask example
result example
this is what i used
convert jpeg_example.jpg -resize 300x500^ -gravity Center -crop 300x500+0+0 -alpha Set mask_example.png \( -clone 0,1 -alpha Opaque -compose Hardlight -composite \) -delete 0 -compose In -composite result.png
the blue line at end are just an error of miniatures, my images are fine
Re: compose one transparent png(as mask) with one jpg
We're using ImageMagick 7.0.8-66, the latest release, and HDRI is not enabled. Your command completes for us in 9 one-hundreds of a second.
Re: compose one transparent png(as mask) with one jpg
im on ubuntu 18.04.3 with imagemagick 6.8
wtf .... with real image i did just 1 convert every 0,41 sec at 100% cpu
maybe php even with shell_exec its not a good idea for mass converting , but helps me alot to keep tracking what's i have done, manage errors and so on ... even directory tree its a pain
im not an bash fan outside easy tasks
i will try something different because i have to covert too many images, at this rate i need months
wtf .... with real image i did just 1 convert every 0,41 sec at 100% cpu
maybe php even with shell_exec its not a good idea for mass converting , but helps me alot to keep tracking what's i have done, manage errors and so on ... even directory tree its a pain
im not an bash fan outside easy tasks
i will try something different because i have to covert too many images, at this rate i need months