使用 Rmagick 创建高质量图像
我需要生成带有高质量文本的图像
我有以下代码,它工作正常,但生成的图像质量低且文本像素化
image = Magick::Image.new(width_image, height_image)
draw = Magick::Draw.new
draw.gravity = Magick::CenterGravity
draw.annotate(image, width_label_last_text, height_label_last_text, x_label_last_text, y_label_last_text, text)
image.format = "jpeg"
image.write("image.jpeg")
我需要生成的图像具有高质量而不是像素化当图像缩放时,
我尝试过密度和质量,但这不起作用
image.write("image.jpeg") do
self.density = 150
self.quality = 90
end
任何想法?
I need to generate an image with a text that has a high quality
I have the following code, it works fine but the generated image is of low quality and the text is pixelated
image = Magick::Image.new(width_image, height_image)
draw = Magick::Draw.new
draw.gravity = Magick::CenterGravity
draw.annotate(image, width_label_last_text, height_label_last_text, x_label_last_text, y_label_last_text, text)
image.format = "jpeg"
image.write("image.jpeg")
I need the generated image to be of high quality and not be pixelated when the image is zoomed
I have tried with density and quality but that does not work
image.write("image.jpeg") do
self.density = 150
self.quality = 90
end
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论