RMagick: Convert CMYK EPS to RGB PNG maintaining transparent background

百般思念 提交于 2019-12-01 19:44:28

do you know about the paint_transparent command for RMagick?

image.paint_transparent(color, opacity=TransparentOpacity, invert=false, fuzz=img.fuzz) -> image

Description Changes the opacity value of all the pixels that match color to the value specified by opacity. If invert is true, changes the pixels that don't match color.

Arguments

color Either a color name or a pixel.

opacity The new opacity value, either an opacity value or a number between 0 and QuantumRange. The default is TransparentOpacity.

invert If true, changes all the pixels that are not the target color.

fuzz By default the pixel must match exactly, but you can specify a tolerance level by passing a positive value.

Returns A new image

Magick API TransparentPaintImage

Have you seen this video of railscasts http://railscasts.com/episodes/374-image-manipulation ? He uses the github logo to create a stamp with transparency.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!