Skip to content

Commit 1630e79

Browse files
add support for Sixel
1 parent 77a37f3 commit 1630e79

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
1212
LazyModules = "8cdb02fc-e678-4876-92c5-9defec4f444e"
1313
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1414
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
15+
Sixel = "45858cf5-a6b0-47a3-bbea-62219f50df47"
1516
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1617
XTermColors = "c8c2cc18-de81-4e68-b407-38a3a0c0491f"
1718

1819
[compat]
1920
BSON = "0.3"
20-
Colors = "0.10 - 0.13"
2121
CSVFiles = "1"
22+
Colors = "0.10 - 0.13"
2223
DataFrames = "0.21 - 0.22, 1"
2324
DeepDiffs = "1"
2425
Distances = "0.7 - 0.10"
@@ -28,6 +29,7 @@ ImageMagick = "0.7, 1"
2829
ImageTransformations = "0.8 - 0.10"
2930
LazyModules = "0.3"
3031
Plots = "= 1.39.0"
32+
Sixel = "0.1.3"
3133
TestImages = "0.6, 1"
3234
XTermColors = "0.2"
3335
julia = "1.6"

src/ReferenceTests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ using FileIO
1111
using SHA
1212
using DeepDiffs
1313
using Random
14+
using Sixel
1415

1516
export
1617
@withcolor,

src/render.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ function render_item(::BeforeAfterImage, item)
3030
println(io, "eltype: ", eltype(item))
3131
println(io, "size: ", map(length, axes(item)))
3232
println(io, "thumbnail:")
33-
strs = @withcolor XTermColors.ascii_show(
34-
item,
35-
Base.invokelatest(XTermColors.TermColor8bit),
36-
:small,
37-
(20, 40)
38-
)
39-
print(io, join(strs, '\n'))
33+
if Base.get_bool_env("REFERENCETESTS_SIXEL", false)
34+
sixel_encode(io, item)
35+
else
36+
strs = @withcolor XTermColors.ascii_show(
37+
item,
38+
Base.invokelatest(XTermColors.TermColor8bit),
39+
:small,
40+
(20, 40)
41+
)
42+
print(io, join(strs, '\n'))
43+
end
4044
read(io, String)
4145
end
4246

0 commit comments

Comments
 (0)