Skip to main content
Fix text file
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM, SVG

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. This hexdumpThis hexdump is what your program should output given that image as an input.

This is a code golf, the answer with the shortest answer in bytes wins!

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM, SVG

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. This hexdump is what your program should output given that image as an input.

This is a code golf, the answer with the shortest answer in bytes wins!

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM, SVG

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. This hexdump is what your program should output given that image as an input.

This is a code golf, the answer with the shortest answer in bytes wins!

Add another acceptable image format
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM, SVG

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. The following text fileThis hexdump is what your program should output given that image as an input.

-- Note to self - Add output file

This is a code golf, the answer with the shortest answer in bytes wins!

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. The following text file is what your program should output given that image as an input.

-- Note to self - Add output file

This is a code golf, the answer with the shortest answer in bytes wins!

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM, SVG

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. This hexdump is what your program should output given that image as an input.

This is a code golf, the answer with the shortest answer in bytes wins!

deleted 1 character in body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23

#Who needs a GUI anyway?

Most people like GUI'sGUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. The following text file is what your program should output given that image as an input.

-- Note to self - Add output file

This is a code golf, the answer with the shortest answer in bytes wins!

#Who needs a GUI anyway?

Most people like GUI's.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. The following text file is what your program should output given that image as an input.

-- Note to self - Add output file

This is a code golf, the answer with the shortest answer in bytes wins!

#Who needs a GUI anyway?

Most people like GUIs.

You don't.

They say that GUI's show them pretty pictures.

##Your task:

Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. "That's a program?" - Some user

#Challenge

  • Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.

  • To output a string in green (#00FF00), you can print \x1b[48;5;46mInsert text here! where \x1b is codepoint 27 (hex 1b).

  • \x1b[48;5;<bgcode>m sets the colour.

  • At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.

  • Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM

  • You may use image processing libraries to parse images.

  • The output must be viewable in any terminal sized over 80x24.

  • If the longest side is the x-axis, its length must be resized to 80.

  • If the longest side is the y-axis, its length must be resized to 24.

  • The aspect ratio of the image must be kept the same. Scale using min(80/X,24/Y), rounding down

  • The output can be assumed to be a console that supports ANSI.

  • Each character of the resized image represents 1 pixel.

  • The characters printed must be a space.

  • The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).

  • In this case, the similarity of 2 colours can be defined as: ((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5 where results closer to zero indicate closer similarity.

  • If your image format supports the alpha channel, you may assume it is empty/doesn't exist.

##Example

PPCG logo

Found here is our beloved logo. The following text file is what your program should output given that image as an input.

-- Note to self - Add output file

This is a code golf, the answer with the shortest answer in bytes wins!

Typos
Source Link
FlipTack
  • 14.7k
  • 24
  • 16
Loading
edited body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
added 10 characters in body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
added 65 characters in body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
deleted 56 characters in body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
remove pop-con
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
Add winning criteria
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
added 140 characters in body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
changed to pop-contest
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
added 380 characters in body
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
made clearer
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
Add direction simularity of colours is in
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
Update spec
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading
Source Link
Blue
  • 28.8k
  • 1
  • 18
  • 23
Loading