1 回答

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個贊
您的命令的 GO 版本convert缺少“密度”參數(shù)。將對的調(diào)用替換為SetImageResolution對的調(diào)用SetOption并使用過濾器來平滑邊緣會產(chǎn)生平滑的圖像:
package main
import "gopkg.in/gographics/imagick.v2/imagick"
func main() {
imagick.Initialize()
defer imagick.Terminate()
mw := imagick.NewMagickWand()
defer mw.Destroy()
mw.SetOption("density", "5000")
mw.SetOption("psd:fit-page", "500x")
mw.ReadImage("test.pdf")
mw.ResizeImage(500, 500, imagick.FILTER_LAGRANGE, 1)
mw.SetIteratorIndex(0) // This being the page offset
mw.SetImageFormat("png")
mw.WriteImage("test.png")
}
- 1 回答
- 0 關(guān)注
- 168 瀏覽
添加回答
舉報