rmagick

RMagick: Convert CMYK EPS to RGB PNG maintaining transparent background

百般思念 提交于 2019-12-01 19:44:28
I've spent a long time trying to go from a CMYK EPS to a RGB PNG using RMagick and Rails. Hopefully this will be of use to someone: def convert_image_from_cmyk_to_rgb( image ) #puts image.alpha? if image.colorspace == Magick::CMYKColorspace image.strip! image.add_profile("#{Rails.root}/lib/USWebCoatedSWOP.icc") image.colorspace == Magick::SRGBColorspace image.add_profile("#{Rails.root}/lib/sRGB.icc") end image end You can download the ICC files direct from Adobe at http://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html The only thing I haven't been able to suss is how to

rmagick is there a way to convert image in memory

二次信任 提交于 2019-12-01 16:56:54
From Rmagick guide: Converting an image to another format Converting an image to another format is as simple as writing the image to a file. ImageMagick uses the output filename suffix (".jpg" for JPEG, ".gif" for GIF, for example) or prefix ("ps:" for PostScript, for example) to determine the format of the output image. Is there a way to convert image in memory? Dan Grahn # assuming you have an image # img = Magick::Image.new( 100, 100 ) img = Magick::Image.from_blob( img.to_blob { self.format = "png" } ) Source: RMagick Docs Here's an example on how to give it to the user image.format = "png

rmagick is there a way to convert image in memory

偶尔善良 提交于 2019-12-01 16:30:03
问题 From Rmagick guide: Converting an image to another format Converting an image to another format is as simple as writing the image to a file. ImageMagick uses the output filename suffix (".jpg" for JPEG, ".gif" for GIF, for example) or prefix ("ps:" for PostScript, for example) to determine the format of the output image. Is there a way to convert image in memory? 回答1: # assuming you have an image # img = Magick::Image.new( 100, 100 ) img = Magick::Image.from_blob( img.to_blob { self.format =

Difference between 'require 'rmagick' and 'require RMagick' (Mac vs Debian)

对着背影说爱祢 提交于 2019-12-01 11:46:17
I'm using a Mac pro Lion for development with ImageMagick Q16, RVM and ruby 1.8.7 I can use the following in IRB: Take note on the different caps in the word 'rmagick' require 'rubygems' => true require 'rmagick' => true require 'RMagick' LoadError: no such file to load -- RMmagick On my Debian Squeeze 6.0 production server with ImageMagick Q16, RVM and ruby 1.8.7 I can use the following in IRB: require 'rubygems' => true require 'rmagick' LoadError: no such file to load -- rmagick require 'RMagick' => true 'gem list' shows on both OS's in lowercase. rmagick (2.13.1) I would like to know the

Error using rmagick in rails application

元气小坏坏 提交于 2019-12-01 10:29:13
问题 I am getting following error when trying to run rails application:- /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so: libMagickCore.so.4: cannot open shared object file: No such file or directory - /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so (LoadError) from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems

Is it possible to render multi-coloured emojis with ImageMagick?

我是研究僧i 提交于 2019-12-01 08:51:06
I have a text that may contain emojis. I want to render it into JPEG image with RMagick (I can also use ImageMagick directly). I was able to render only monochrome emojis with AndroidEmoji.ttf, but ImageMagick renders interrogation signs if I use AppleColorEmoji.ttf. Here's how I do it: require 'rmagick' granite = Magick::ImageList.new('granite:') canvas = Magick::ImageList.new canvas.new_image(300, 100, Magick::TextureFill.new(granite)) input = "👠 👯👢 👣" text = Magick::Draw.new text.font = 'AppleColorEmoji.ttf' text.pointsize = 20 text.gravity = Magick::CenterGravity text.annotate(canvas, 0, 0

Difference between 'require 'rmagick' and 'require RMagick' (Mac vs Debian)

情到浓时终转凉″ 提交于 2019-12-01 08:40:26
问题 I'm using a Mac pro Lion for development with ImageMagick Q16, RVM and ruby 1.8.7 I can use the following in IRB: Take note on the different caps in the word 'rmagick' require 'rubygems' => true require 'rmagick' => true require 'RMagick' LoadError: no such file to load -- RMmagick On my Debian Squeeze 6.0 production server with ImageMagick Q16, RVM and ruby 1.8.7 I can use the following in IRB: require 'rubygems' => true require 'rmagick' LoadError: no such file to load -- rmagick require

Is it possible to render multi-coloured emojis with ImageMagick?

时间秒杀一切 提交于 2019-12-01 07:51:48
问题 I have a text that may contain emojis. I want to render it into JPEG image with RMagick (I can also use ImageMagick directly). I was able to render only monochrome emojis with AndroidEmoji.ttf, but ImageMagick renders interrogation signs if I use AppleColorEmoji.ttf. Here's how I do it: require 'rmagick' granite = Magick::ImageList.new('granite:') canvas = Magick::ImageList.new canvas.new_image(300, 100, Magick::TextureFill.new(granite)) input = "👠 👯👢 👣" text = Magick::Draw.new text.font =

Paperclip error - NotIdentifiedByImageMagickError

随声附和 提交于 2019-12-01 05:23:54
I'm trying to upload images to aws s3 with paperclip but I get this error Command :: file -b --mime '/var/folders/d_/k4_ps9hj5fj_3df5t210vjym0000gn/T/2611a2396a4af6938e5c5867c8bb409f20140515-7787-1u773ft.jpg' Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/d_/k4_ps9hj5fj_3df5t210vjym0000gn/T/2611a2396a4af6938e5c5867c8bb409f20140515-7787-1rep3kt.jpg[0]' 2>/dev/null [paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError> Command :: identify -format '%wx%h,%[exif:orientation

Paperclip error - NotIdentifiedByImageMagickError

橙三吉。 提交于 2019-12-01 01:58:57
问题 I'm trying to upload images to aws s3 with paperclip but I get this error Command :: file -b --mime '/var/folders/d_/k4_ps9hj5fj_3df5t210vjym0000gn/T/2611a2396a4af6938e5c5867c8bb409f20140515-7787-1u773ft.jpg' Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/d_/k4_ps9hj5fj_3df5t210vjym0000gn/T/2611a2396a4af6938e5c5867c8bb409f20140515-7787-1rep3kt.jpg[0]' 2>/dev/null [paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: