~dricottone/image2ascii

b7f7c9cef6ef2c06839370af9dbe8ad2d854140e — liujj 6 years ago c55f95a
Fixed a slice allocate issue
1 files changed, 1 insertions(+), 1 deletions(-)

M convert/convert.go
M convert/convert.go => convert/convert.go +1 -1
@@ 26,7 26,7 @@ func Image2ASCIIMatrix(image image.Image, imageConvertOptions *Options) []string
	sz := newImage.Bounds()
	newWidth := sz.Max.Y
	newHeight := sz.Max.X
	rawCharValues := make([]string, int(newWidth*newHeight))
	rawCharValues := make([]string, 0, int(newWidth*newHeight+newWidth))
	for i := 0; i < int(newWidth); i++ {
		for j := 0; j < int(newHeight); j++ {
			pixel := color.NRGBAModel.Convert(newImage.At(j, i))