Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 2.99 KB

README.md

File metadata and controls

48 lines (37 loc) · 2.99 KB

img2pixels

Resize and convert image to hex pixel values.

TODO

  • Resize image
  • Dump pixel codes to stdout
  • Dump resized image to test.png
  • Select resizing method

Installation

go install github.com/jdtobe/img2pixels

Usage

To use img2pixels, simply execute:

img2pixels [-width=x] [-height=y] {input_image}

Note: width and height default to 16.

Example Output:

➜  img2pixels git:(master) ✗ ./img2pixels lavender.jpg 
0xDCCFA9, 0xE0D4AC, 0xDFD3AB, 0xD9CBA6, 0xD7C7A1, 0xD3C29D, 0xCFBC98, 0xC7B391, 0xBAA686, 0xAF9B7F, 0xA6947A, 0x9B8A72, 0x9B8970, 0x756859, 0x383539, 0x7D7672, 
0x857D77, 0x474346, 0x60564D, 0xA18F74, 0x9D8C74, 0xA9967B, 0xB6A182, 0xB7A089, 0xC4AD95, 0xD2C09A, 0xD7C5A0, 0xDACAA4, 0xDED0A9, 0xE0D4AC, 0xDFD3AC, 0xDED3AC, 
0xE2D7B1, 0xE1D6AF, 0xE1D5AD, 0xE0D2AB, 0xDECDA7, 0xDECCA4, 0xDDC9A1, 0xB7A28B, 0x928074, 0xB7A084, 0xAD987D, 0xA89479, 0xA39076, 0x4D4642, 0x645F5D, 0x87807A, 
0x857E78, 0x766F6B, 0x423D3E, 0x9C8972, 0x998771, 0x93836F, 0x9C8776, 0x7D7766, 0xBAAB8D, 0xCAB699, 0xC8B49C, 0xDCCAA7, 0xE1D2AA, 0xE2D6AE, 0xE2D7B0, 0xDDD1AD, 
0xE2D7B4, 0xE0D4AF, 0xE2D4AE, 0xE2D3AB, 0xDDCAA9, 0xBCA997, 0xBDB290, 0xACA483, 0x757C62, 0x78735F, 0x7E7866, 0x9A8577, 0x8F7C69, 0x443D3F, 0x7A726C, 0x87807A, 
0x8A837C, 0x8F847C, 0x575251, 0x71695D, 0xC8B08D, 0x937862, 0x44493F, 0x596A55, 0x898C6F, 0xAAA788, 0xCCB79E, 0xE4D1AA, 0xE1D0AB, 0xE3D4AF, 0xE2D6B2, 0xE9DEBB, 
0xECE1BE, 0xE9DDB9, 0xE8D9B5, 0xE2D1AD, 0xE2CFAB, 0xD9C2A5, 0xABA588, 0x6B7D64, 0x465D4A, 0x354239, 0x8D4B45, 0xA85148, 0x874641, 0x6B5553, 0x847F79, 0x8E867F, 
0x4F4F53, 0x4D3B40, 0x923031, 0xA83736, 0xA53234, 0x924846, 0x31463C, 0x405A48, 0x657964, 0xA3A081, 0xAEAD8C, 0xC5C1A3, 0xBFB2A5, 0xEFE0C1, 0xE8DCB8, 0xEFE5C4, 
0xF2E9C9, 0xEDE1BE, 0xEFE3BF, 0xEADAB7, 0xD8CDAA, 0xA7AD8C, 0x7F8D6D, 0x597156, 0x48624E, 0x385441, 0x85423E, 0xB73C3C, 0xAA3C3A, 0xAA3735, 0x6F3034, 0x484A50, 
0x615557, 0x842C2D, 0xB7413C, 0xBD453F, 0xC84642, 0x995046, 0x395942, 0x577054, 0x687D5C, 0x9FA381, 0xDDCFAD, 0xEFDCB8, 0xEBDCB8, 0xF0E3BF, 0xEFE4C0, 0xF2EACB, 
0xF9F4D7, 0xF2E9C6, 0xF0E5C1, 0xF0E2BE, 0xEDDEBA, 0xECD9B5, 0xD0C2A1, 0x708362, 0x445A40, 0x51635E, 0xAD6565, 0xD75247, 0xD15548, 0xC64B41, 0x9B3532, 0x675657, 
0x5D5B5C, 0x9B554E, 0xD25041, 0xE66551, 0xEC6454, 0xBB6F66, 0x576E5E, 0x5F6F54, 0xA4A583, 0xDBCBA9, 0xEAD8B3, 0xEFE0BB, 0xF4E8C4, 0xF4EAC7, 0xF6EFCD, 0xFBFAE1, 
0xFAFAE7, 0xF8F4D2, 0xF7EECB, 0xF2E6C2, 0xEADCB6, 0xE4D3AD, 0xE9D3AC, 0xC0B493, 0x798768, 0x475A46, 0xE47869, 0xF77260, 0xD76A57, 0xA3695E, 0x857E78, 0x645F61, 
0x5E585B, 0x817772, 0x7F7C76, 0x786C65, 0x624746, 0xC56F62, 0x97715E, 0x8B9071, 0xB9A789, 0xA19482, 0xCCBC9B, 0xDFD0AB, 0xE7DAB7, 0xF0E7C4, 0xFCF7D3, 0xFDFEF2, 
0xE9E9E4, 0xB3AFA4, 0xBEB5A1, 0xBFB39A, 0xBBAB8F, 0xA79C88, 0x5E6270, 0x907F6F, 0x95886F, 0xA7876E, 0x6F5D4F, 0x312D32, 0x695D58, 0x837871, 0x78706D, 0x514B4D, 
0x6D6666, 0x676161, 0x6E6763, 0x5E514C, 0x433634, 0x82725C, 0x908069, 0x9B8970, 0x86796D, 0x5F6476, 0xA39684, 0xAC9D85, 0xB3A793, 0xB4AC9D, 0xB8B7B3, 0xF0F1F1,