Hi, I recently took a screenshot with Angband. The file was saved in PNG format. Now I would like to upload it in the screenshots section but first I have to convert it to HTML code because PNG isn't allowed. How do I do that? Thanks for your help!
How to convert PNG to HTML code?
Collapse
X
-
Tags: None
-
Too bad. I found this webpage here where PNGs can be converted to base64 strings. Works great with IE 11 for example. But the upload script does not accept the generated string unfortunately.This seems a quiet, peaceful place.Comment
-
Too bad. I found this webpage here where PNGs can be converted to base64 strings. Works great with IE 11 for example. But the upload script does not accept the generated string unfortunately.
A PNG can be viewed in two different ways:
1) To the computer, it is a long string of binary data. (You can open it in a hex editor to see this view.)
2) When displayed to the user, it contains meaningful visual information, such as in this case showing the layout of a dungeon.
It's very easy to manipulate the PNG in terms of 1). What you've found is a program that takes the binary representation of the PNG (the data that it is written as on a hard drive) and transforms it into the base64 equivalent - which is the exact same data, just in a form that can be sent over a text-only means of communication, such as an email, then un-base64'd to get the original PNG. Needless to say, the angband.oook.cz server has no idea what to do with a base64'd PNG just as much as it doesn't know what to do with a GIF, BMP or random text hammered into the submission box.
What you are looking for is manipulating the PNG in terms of 2). As in, you want to represent the visual information of the PNG in another way - in terms of the symbols and colours and characters contained within it, in such a way that you could pass this information around as text. This is a difficult problem, because computers have no innate idea of what it means to parse an image - this problem is called Optical Character Recognition. http://en.wikipedia.org/wiki/Optical...er_recognition
There are plenty of OCR programs out there - that are great at extracting the text from a scanned or screenshotted paper, for example - but I find it very unlikely that it would maintain the 1) colour information 2) specific monospacing that you would need, which is not something that matters for the use cases OCR is developed for. So, there is probably no easy solution for what you want.My Chiptune music, made in Famitracker: http://soundcloud.com/patashuComment
-
Okay thank you. Next time I'll use the ')' command.
By the way, why it is forbidden to upload images? If size matters the maximum image file size and dimensions could be limited.This seems a quiet, peaceful place.Comment
-
-
Also, PNGs can't be read by blind people using screen reading programs, whereas HTML 'screenshots' can be. (Yes! A lot of blind or partially blind people play text and ASCII based games.)My Chiptune music, made in Famitracker: http://soundcloud.com/patashuComment
Comment