# Mapping circular image onto surface

I am trying to map the image "Angels and Devils" by M.C. Escher onto a cigar-like shape. The code I have now is

With[
{
img = Import[
]
}
,
RevolutionPlot3D[
{Sqrt[1 + t^2/10 - 1/t^2], t}
, {t, 0.957122, 7.5}
, Mesh -> None
, Axes -> False
, PlotStyle -> Texture[img]
, TextureCoordinateFunction -> ({#1, #2} &)
]
]


Where circle-limit-iv.jpg is the image file.

The problem is that this image has some white space around the circle, since the image is actually a rectangle.

I would like to have it so that the edge of the circle is mapped to the edge of the surface. Is there any way to do this?

• I edited your question to provide a working example, but I don't see the problem you describe. You can revert the edit, if you feel my edit changed your question in an undesirable way, or edit again to show this time a complete working example of your problem. – rhermans Jun 21 '18 at 13:11
• Thanks for taking the tour!. There are things to do after your question is answered. It's a good idea to stay vigilant for some time, better approaches may come later improving over previous replies. Experienced users may point alternatives, caveats or limitations. New users should test answers before voting and wait 24 hours before accepting the best one. Participation is essential for the site, please do your part. Also consider choosing a meaningful username, if you want. – rhermans Jun 21 '18 at 14:17

rhermans gave you already the answer, however with your and with every image that has a uniform padding, you can simply call ImageCrop without parameters. Here is a better resolution of the image and after cropping, you can directly use it as a texture

tex = ImageCrop@Import[

RevolutionPlot3D[{Sqrt[1 + t^2/10 - 1/t^2], t},
{t, 0.957122, 7.5},
Mesh -> None,
Axes -> False,
PlotStyle -> Texture[img],
TextureCoordinateFunction -> ({#1, #2} &),
Lighting -> {{"Ambient", ColorData[97, 2]}}
]


To crop your image into a square you can use

ImageCrop[#, Min[ImageDimensions[#]] {1, 1}] &


Example

With[
{
CropSquare = ImageCrop[#, Min[ImageDimensions[#]] {1, 1}] &
}
, CropSquare[ExampleData[{"TestImage", "Apples"}]]
]


• You got my upvote! I haven't noticed your answer until I had searched for a better image and prepared the example so I just went ahead and posted it although you already said the ImageCrop is the solution. – halirutan Jun 21 '18 at 14:14