Skip to content

x/mosaic rendering width does not bake in assumptions about character aspect ratio #705

@minkezhang

Description

@minkezhang

Description

Given the example in x/mosaic, if I were instead to remove the lines enforcing a height and width, the documentation states that the default here should be the base image height and width. Given the input image of a square --

Image
m := mosaic.New() // .Width(80).Height(40)

I would expect that the terminal render would still be a square. However, we see the actual output

Image

The fix seems to be manually changing the render width to twice the image size, as reported by img.Bounds().Max.X, i.e.

mosaic.New().Width(img.Bounds().Max.X * 2).Render(...)

Is this behavior expected?

Version

No response

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions