Skip to content

Conversation

@j4james
Copy link
Collaborator

@j4james j4james commented Feb 1, 2025

Summary of the Pull Request

When Sixel images are rendered, they're automatically scaled to match
the 10x20 cell size of the original hardware terminals. If this requires
the image to be scaled down, the default GDI stretching mode can produce
ugly visual artefacts, particularly for color images. This PR changes
the stretching mode to COLORONCOLOR, which looks considerably better,
but without impacting performance.

References and Relevant Issues

The initial Sixel implementation was added in PR #17421.

Validation Steps Performed

I've tested with a number of different images using a small font size to
trigger the downscaling, and I think the results are generally better,
although simple black on white images are still better with the default
mode (i.e. BLACKONWHITE), which is understandable.

I've also checked the performance with a variation of the sixel-bench
test, and confirmed that the new mode is no worse than the default.

@j4james
Copy link
Collaborator Author

j4james commented Feb 1, 2025

Some example images demonstrating the difference between the original mode (on the left) and the new mode (on the right).

image

@j4james
Copy link
Collaborator Author

j4james commented Feb 1, 2025

I should mention there is also a HALFTONE mode, which handle the black-on-white case better, but the performance is terrible - it's about half the speed - so I didn't think it was worth it.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks perfect to me. Thanks!

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@DHowett
Copy link
Member

DHowett commented Feb 3, 2025

/azp run

so tired of this new policy already

@azure-pipelines
Copy link

Command 'run

so' is not supported by Azure Pipelines.



Supported commands

  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@DHowett
Copy link
Member

DHowett commented Feb 3, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DHowett DHowett enabled auto-merge (squash) February 3, 2025 22:14
@DHowett DHowett merged commit b243fb6 into microsoft:main Feb 3, 2025
12 of 14 checks passed
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.22 Servicing Pipeline Apr 28, 2025
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.23 Servicing Pipeline Apr 28, 2025
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.22 Servicing Pipeline Apr 28, 2025
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.23 Servicing Pipeline Apr 28, 2025
DHowett pushed a commit that referenced this pull request Apr 29, 2025
When Sixel images are rendered, they're automatically scaled to match
the 10x20 cell size of the original hardware terminals. If this requires
the image to be scaled down, the default GDI stretching mode can produce
ugly visual artefacts, particularly for color images. This PR changes
the stretching mode to `COLORONCOLOR`, which looks considerably better,
but without impacting performance.

The initial Sixel implementation was added in PR #17421.

## Validation Steps Performed

I've tested with a number of different images using a small font size to
trigger the downscaling, and I think the results are generally better,
although simple black on white images are still better with the default
mode (i.e. `BLACKONWHITE`), which is understandable.

I've also checked the performance with a variation of the [sixel-bench]
test, and confirmed that the new mode is no worse than the default.

[sixel-bench]: https://github.com/jerch/sixel-bench

(cherry picked from commit b243fb6)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ0dHI
Service-Version: 1.22
DHowett pushed a commit that referenced this pull request Apr 29, 2025
When Sixel images are rendered, they're automatically scaled to match
the 10x20 cell size of the original hardware terminals. If this requires
the image to be scaled down, the default GDI stretching mode can produce
ugly visual artefacts, particularly for color images. This PR changes
the stretching mode to `COLORONCOLOR`, which looks considerably better,
but without impacting performance.

The initial Sixel implementation was added in PR #17421.

## Validation Steps Performed

I've tested with a number of different images using a small font size to
trigger the downscaling, and I think the results are generally better,
although simple black on white images are still better with the default
mode (i.e. `BLACKONWHITE`), which is understandable.

I've also checked the performance with a variation of the [sixel-bench]
test, and confirmed that the new mode is no worse than the default.

[sixel-bench]: https://github.com/jerch/sixel-bench

(cherry picked from commit b243fb6)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZ0dHA
Service-Version: 1.23
@j4james j4james deleted the improve-sixel-gdi branch May 3, 2025 11:44
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.23 Servicing Pipeline Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Cherry Picked

Development

Successfully merging this pull request may close these issues.

3 participants