Page 4 of 4
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-09T08:27:19-07:00
by Morphleus
Hi everybody,
I'm coming back because I have an issue since I change my dedicated server and my version of ImageMagick.
Before everything was good with that script
Code: Select all
convert -size 1330x1026 xc:black -virtual-pixel Transparent \
\( fr.jpg -matte -resize 1600x1074\! \
\( -clone 0 -crop 758x0+0+0\! \
+distort Perspective '0,0 62,80 0,1073 62,897 739,1073 628,912 739,0 628,64' \) \
\( -clone 0 -crop 84x0+758+0\! \
+distort Perspective '0,0 628,38 0,1073 628,922 83,1073 688,937 83,0 688,30' \) \
\( -clone 0 -crop 758x0+842+0\! \
+distort Perspective '0,0 688,30 0,1073 688,937 757,1073 1228,883 757,0 1228,80' \) \
-delete 0 \) \
-layers merge \
cover_light.png -compose HardLight -composite \
cover_opacity.png -alpha Off -compose Copy_Opacity -composite \
-resize 420x324\! -quality 95 -depth 8 test.png
you can see the result here
before with ImageMagick 6.4.2 07/07/08
now with ImageMagick 6.6.0-4 2012-03-05
How can I do to solve that ?
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-09T11:56:16-07:00
by fmw42
I don't see any obvious difference. What do you see that is wrong?
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-09T13:21:28-07:00
by Morphleus
It will be easier with giant pics
before
http://imageup.fr/uploads/1334002585.png
after
http://imageup.fr/uploads/1334002676.png
you can see that there are problems at the bottom of the pictures, borders are not black around and colors are brigther.
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-09T13:51:07-07:00
by fmw42
Your distort perspective probably needs to have -virtual-pixel set to black or transparent. It seems to be getting edge. Can you post a link to your input image, so that we can test your code with it?
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-09T14:00:35-07:00
by Morphleus
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-09T15:11:09-07:00
by fmw42
This works perfectly fine form me under IM 6.7.6.5 Q16 Mac OSX Snow Leopard. Perhaps it is a version problem. Try upgrading and test again.
Note I removed the last resize to get the full resolution image.
convert -size 1330x1026 xc:black -virtual-pixel Transparent \
\( fr.jpg -matte -resize 1600x1074\! \
\( -clone 0 -crop 758x0+0+0\! \
+distort Perspective '0,0 62,80 0,1073 62,897 739,1073 628,912 739,0 628,64' \) \
\( -clone 0 -crop 84x0+758+0\! \
+distort Perspective '0,0 628,38 0,1073 628,922 83,1073 688,937 83,0 688,30' \) \
\( -clone 0 -crop 758x0+842+0\! \
+distort Perspective '0,0 688,30 0,1073 688,937 757,1073 1228,883 757,0 1228,80' \) \
-delete 0 \) \
-layers merge \
cover_light.png -compose HardLight -composite \
cover_opacity.png -alpha Off -compose Copy_Opacity -composite \
-quality 95 -depth 8 test.png
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-10T08:37:44-07:00
by Morphleus
I have just installed the last version
ImageMagick 6.7.6-5 2012-04-10 Q16. I have another problem right now... When I launched the command I have this error
Code: Select all
convert: no decode delegate for this image format `fr.jpg' @ error/constitute.c/ReadImage/533.
convert: image sequence is required `-clone' @ error/convert.c/ConvertImageCommand/927.
When I did the make check there was no error with convert function.
I saw that I need to install delegates. libjpeg seems not exist anymore...
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-10T09:12:35-07:00
by Morphleus
Everything seems to be fixed.
I installed delegates and it works. So it was a bug in the previous version.
Thanks guy for your support.
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-10T22:29:55-07:00
by anthony
As an addendum to this topic. You can merge the cover_light.png and cover_opacity.png into a single image.
For details see.. IM Examples, Thumbnails and Framing, Lighting Mask
http://www.imagemagick.org/Usage/thumbn ... hting_mask
and more specifically, exampled in Badge using Lighting effects
http://www.imagemagick.org/Usage/thumbn ... e_lighting
You can even take it further and convert the multiple distorts into distortion/displacement maps.
these can then also be merged so that you use a single 4 channel PNG, image containing
X,Y displacement maps, shading map, and transparency mask
That encapulates the whole process, for any distortion, shading, and transparency you like.
See an example of this in Unified Distortion Maps
http://www.imagemagick.org/Usage/mappin ... on_unified
Re: convert a picture to a 3D DVD cover
Posted: 2012-04-16T04:12:35-07:00
by Morphleus
anthony wrote:You can even take it further and convert the multiple distorts into distortion/displacement maps.
these can then also be merged so that you use a single 4 channel PNG, image containing
X,Y displacement maps, shading map, and transparency mask
That encapulates the whole process, for any distortion, shading, and transparency you like.
See an example of this in Unified Distortion Maps
http://www.imagemagick.org/Usage/mappin ... on_unified
It's really impressive but it seems very difficult to transform my distortions into gray gradients...
Actually the way to do it is start with two images a X gradient (black left), and a Y gradient (black at top).
distort them as usual but don't do the masking and shading. The results are absolute distortion maps that
then replace the distortions. They can also be converted to relative distortion maps, though really their
is no need.
Note while I have not exampled it (it was added after last worked on the mapping examples page) their is a 'distort' compose method that is similar to that of the 'displace' distortion method. This gets rid of the current slow 'fx' expressions.
Re: convert a picture to a 3D DVD cover
Posted: 2013-04-05T17:29:34-07:00
by gruz
Is there any chance to restore images from this post?
viewtopic.php?f=1&t=11726&start=15#p45644
Please!
Re: convert a picture to a 3D DVD cover
Posted: 2013-04-05T17:45:28-07:00
by fmw42
I do not see any missing pictures at the link specified in that topic.
Re: convert a picture to a 3D DVD cover
Posted: 2013-04-05T17:50:01-07:00
by gruz
Please, have a look at how I see the post:
Re: convert a picture to a 3D DVD cover
Posted: 2013-04-05T18:27:57-07:00
by fmw42
You are right. But the OP will have to repost those. They are not hosted on the IM servers.
Re: convert a picture to a 3D DVD cover
Posted: 2013-04-05T19:11:50-07:00
by gruz
So just to restore the manual.
One must have 2 own images and 3 core images (keep untouched). Download them to a folder, rename image files as shown with bold and run the code:
Own images (the ones you have to modify at your own - YOUR cover and YOUR disc image):
cover.png
label.jpg
And three core images:
label_opacity.png
cover_label_light.png
cover_label_opacity.png
And here is the result:
preview.png
Code: Select all
convert -virtual-pixel Transparent \
cover.png -matte -resize 1600x1074\! \
\( -clone 0 -crop 740x0+0+0\! \
+distort Perspective '0,0 62,80 0,1073 62,897 739,1073 628,912 739,0 628,64' \
\) \
\( -clone 0 -crop 84x0+758+0\! \
+distort Perspective '0,0 628,38 0,1073 628,922 83,1073 688,937 83,0 688,30' \
\) \
\( -clone 0 -crop 758x0+842+0\! \
+distort Perspective '0,0 688,30 0,1073 688,937 757,1073 1228,883 757,0 1228,80' \
\) \
-size 1700x1026 xc:black -swap 0,-1 +delete \
\( label.jpg -resize 510x510\! label_opacity.png -alpha On -compose Copy_Opacity -composite \
-crop 410x0+100+0\! -repage +1232+229 \
\) \
-compose Over -layers merge \
cover_label_light.png -compose HardLight -composite \
cover_label_opacity.png -alpha On -compose Copy_Opacity -composite \
-resize 1260x760\! -quality 95 -depth 8 preview.png
To compare with the code I have taken from this topc, I have had to turn Alpha On, as with Off it was generating something bad.