Is it possible to make a full circled version of an image without cutting a rectangular image manually ? Will this module allow that to happen or is the best way to do this type of thing is just manually cut out images in photoshop into circles and upload the already circled image ?

Like think of scrap booking, sometimes we want an image to be surrounded by different shapes like stars, circles, triangles or funny type of shapes. What's the best way to do a circle pretty much ?

Found some css3 examples http://webdesignerwall.com/tutorials/css3-image-styles . Is it possible to add these types of effects using this module or using css3 is best ?

Comments

fietserwin’s picture

This is probably the mask effect. Find a grayscale mask (in your case a white circle with black edges) and use that for the mask effect. The grayscale determines how transparent a pixel becomes: white = fully opaque, black = fully transparent (thus invisible). You will probably have to add a change format effect (to png) as well, or you will get white edges in your result.

goldlilys’s picture

Do you mean use Alpha blending with a mask image (is this any shape or the shape of what the image should be? ) where the outer border is whatever color I want the edge to be right ? Where is the grayscale coming from or I have to do that mask in photoshop first ? Sorry, not really a graphics person.

fietserwin’s picture

The mask you will indeed have to create yourself or find on the internet, e.g. http://css-tricks.com/webkit-image-wipes/. Note: I guess you meant the effect as described in this article. Our mask effect is the same as the -webkit-mask-box-image effect from the webkit browser.

jonshot’s picture

If you know the size of your final image, you can just create an image style which uses the rounded corner effect from image cache canvas actions, probably combined with a scale and crop. Just set the corner radius to half the width of your image, so for an image 100 x 100px image, set the radius to 50 an you'll end up with a circular image.

fietserwin’s picture

Status: Active » Closed (works as designed)
StatusFileSize
new65.82 KB

Good idea, I tested it and it works, see attached image. This closes this issue I think.

ScreenHunter_30 Nov. 20.jpg

Or using the export option (as of 7.x-1.x-dev version) of the Image styles admin sub module:
a:5:{s:4:"isid";s:2:"19";s:4:"name";s:12:"test-1740120";s:6:"module";N;s:7:"storage";i:1;s:7:"effects";a:3:{i:26;a:12:{s:5:"label";s:21:"Schalen en bijsnijden";s:4:"help";s:203:"Bij het schalen blijft de breedte-hoogte verhouding van de oorspronkelijke afbeelding behouden. Bij het bijsnijden wordt de langste zijde ingekort. Hiermee kunt u bijvoorbeeld vierkante miniaturen maken.";s:15:"effect callback";s:27:"image_scale_and_crop_effect";s:19:"dimensions callback";s:23:"image_resize_dimensions";s:13:"form callback";s:17:"image_resize_form";s:13:"summary theme";s:20:"image_resize_summary";s:6:"module";s:5:"image";s:4:"name";s:20:"image_scale_and_crop";s:4:"data";a:2:{s:5:"width";s:3:"200";s:6:"height";s:3:"200";}s:4:"ieid";s:2:"26";s:4:"isid";s:2:"19";s:6:"weight";s:1:"1";}i:27;a:12:{s:5:"label";s:15:"Rounded Corners";s:4:"help";s:79:"This is true cropping, not overlays, so the result <em>can</em> be transparent.";s:15:"effect callback";s:34:"canvasactions_roundedcorners_image";s:22:"dimensions passthrough";b:1;s:13:"form callback";s:33:"canvasactions_roundedcorners_form";s:13:"summary theme";s:36:"canvasactions_roundedcorners_summary";s:6:"module";s:24:"imagecache_canvasactions";s:4:"name";s:28:"canvasactions_roundedcorners";s:4:"data";a:2:{s:6:"radius";s:3:"100";s:23:"independent_corners_set";a:2:{s:19:"independent_corners";i:0;s:5:"radii";a:4:{s:2:"tl";i:0;s:2:"tr";i:0;s:2:"bl";i:0;s:2:"br";i:0;}}}s:4:"ieid";s:2:"27";s:4:"isid";s:2:"19";s:6:"weight";s:1:"2";}i:28;a:12:{s:5:"label";s:18:"Change file format";s:4:"help";s:49:"Choose to save the image as a different filetype.";s:15:"effect callback";s:26:"coloractions_convert_image";s:22:"dimensions passthrough";b:1;s:13:"form callback";s:25:"coloractions_convert_form";s:13:"summary theme";s:28:"coloractions_convert_summary";s:6:"module";s:23:"imagecache_coloractions";s:4:"name";s:20:"coloractions_convert";s:4:"data";a:2:{s:6:"format";s:9:"image/png";s:7:"quality";s:2:"75";}s:4:"ieid";s:2:"28";s:4:"isid";s:2:"19";s:6:"weight";s:1:"3";}}}
You can import it when you have the Image styles admin sub module enabled.

jackhutton’s picture

Great post. I followed the screengrab & generated my circular image presets.. Thank You!

goldlilys’s picture

Awesome. Thank you also for the instructions.

zilla’s picture

i did the circular presets, though i'd love to be able to drop shadow or draw a border to the circle, but this would appear to not be possible with presets because we're still dealing with a rectangle, albeit with transparencies in a png presenting a circle through css

anybody every generate a true modification for a circular image to which effects may be applied?

fietserwin’s picture

StatusFileSize
new27.14 KB

A border is easy. Extend the image style from #5 with a define canvas (in the vorder color) and do again a rounded corners, now with the border radius added:
a:3:{s:4:"name";s:15:"example-1740120";s:5:"label";s:15:"example-1740120";s:7:"effects";a:4:{i:229;a:3:{s:4:"name";s:20:"image_scale_and_crop";s:4:"data";a:2:{s:5:"width";s:3:"300";s:6:"height";s:3:"300";}s:6:"weight";s:1:"1";}i:230;a:3:{s:4:"name";s:28:"canvasactions_roundedcorners";s:4:"data";a:2:{s:6:"radius";s:3:"150";s:23:"independent_corners_set";a:2:{s:19:"independent_corners";i:0;s:5:"radii";a:4:{s:2:"tl";i:0;s:2:"tr";i:0;s:2:"bl";i:0;s:2:"br";i:0;}}}s:6:"weight";s:1:"2";}i:231;a:3:{s:4:"name";s:26:"canvasactions_definecanvas";s:4:"data";a:4:{s:3:"RGB";a:1:{s:3:"HEX";s:7:"#ff0000";}s:5:"under";i:1;s:5:"exact";a:4:{s:5:"width";s:0:"";s:6:"height";s:0:"";s:4:"xpos";s:6:"center";s:4:"ypos";s:6:"center";}s:8:"relative";a:4:{s:8:"leftdiff";s:2:"10";s:9:"rightdiff";s:2:"10";s:7:"topdiff";s:2:"10";s:10:"bottomdiff";s:2:"10";}}s:6:"weight";s:1:"3";}i:232;a:3:{s:4:"name";s:28:"canvasactions_roundedcorners";s:4:"data";a:2:{s:6:"radius";s:3:"160";s:23:"independent_corners_set";a:2:{s:19:"independent_corners";i:0;s:5:"radii";a:4:{s:2:"tl";i:0;s:2:"tr";i:0;s:2:"bl";i:0;s:2:"br";i:0;}}}s:6:"weight";s:1:"4";}}}

ScreenHunter_98 Oct. 30.jpg

A drop shadow is trickier. I guess you have to revert to css-3 for that, unless someone else is more creative than I am here.

fietserwin’s picture

Issue summary: View changes

Examples

zilla’s picture

Issue summary: View changes
StatusFileSize
new88.13 KB
new87.33 KB

for those interested, here's a couple of screenshots of the filters i applied and the order in which they're applied to create (in my use case) a:

rounded profile picture with thin 5px border around it...images attached (not sure how they'll present in the NEW drupal.org issue queue format ;)

alan d.’s picture

Nice, I have transparent PNGs too and I had to add a second canvas (relative size setting all to 0) before the first rounded corners.

Manual Crop: Crop and scale 120x120
Change file format Convert to: png
Define canvas left:0 right:0 top:0 bottom:0 #ffffff under image
Rounded Corners 60px
Define canvas left:5 right:5 top:5 bottom:5 #cccccc under image
Rounded Corners 65px

Manovra76’s picture

#Alan D

Perfect!
Another example:

Scala e ritaglia 200x200
Change file format Convert to: png
Define canvas left:0 right:0 top:0 bottom:0 ##ffffff under image
Rounded Corners 100px (50% of dimension)
Define canvas left:5 right:5 top:5 bottom:5 ##6dc173 under image
Rounded Corners 105px (50%+5px of dimension)

fabriolle’s picture

Conversione PNG
Scala e ritaglia 300×300
Imposta tela - Dimensione esatta: 100%x100% Posizionamento: center-center - Colore: Trasparente
IEK - Corner ( radius: 150px )
IEK - Border ( border color: #FFFFFF, border top: 30px, border right: 30px, border bottom: 30px, border left: 30px )