Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > The real world > Idle chatter

Reply
 
Thread Tools Display Modes
Old May 27, 2014, 23:39   #1
Netcracker
Rookie
 
Join Date: May 2014
Posts: 9
Netcracker is on a distinguished road
Question How to convert PNG to HTML code?

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!
Netcracker is offline   Reply With Quote
Old May 27, 2014, 23:48   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,394
Donated: $60
Nick will become famous soon enough
Sorry, but you need to take the screenshot in game, using the ')' command. That will save an html screenshot in your user directory.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old May 27, 2014, 23:58   #3
Netcracker
Rookie
 
Join Date: May 2014
Posts: 9
Netcracker is on a distinguished road
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.
Netcracker is offline   Reply With Quote
Old May 28, 2014, 03:01   #4
Patashu
Knight
 
Patashu's Avatar
 
Join Date: Jan 2008
Posts: 526
Patashu is on a distinguished road
Quote:
Originally Posted by Netcracker View Post
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.
There is a fundamental misunderstanding here.
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/patashu
Patashu is offline   Reply With Quote
Old May 28, 2014, 11:23   #5
Netcracker
Rookie
 
Join Date: May 2014
Posts: 9
Netcracker is on a distinguished road
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.
Netcracker is offline   Reply With Quote
Old May 28, 2014, 14:48   #6
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 9,024
Derakon is on a distinguished road
Pav wrote the website, so it's his decision, but one reason I can think of is to avoid having random people use the screenshot section for image hosting of images unrelated to Angband.
Derakon is offline   Reply With Quote
Old May 28, 2014, 19:05   #7
Netcracker
Rookie
 
Join Date: May 2014
Posts: 9
Netcracker is on a distinguished road
That sounds reasonable indeed.
Netcracker is offline   Reply With Quote
Old May 28, 2014, 23:23   #8
Patashu
Knight
 
Patashu's Avatar
 
Join Date: Jan 2008
Posts: 526
Patashu is on a distinguished road
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/patashu
Patashu is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot read file '64x64.png' ZenDragon Vanilla 3 August 27, 2013 16:18
Cannot open file 64x64.png Old Coach Development 7 December 7, 2012 03:23
I'm a convert! Therem Harth Vanilla 24 October 1, 2012 04:25
HTML/Web Editor buzzkill Idle chatter 14 October 22, 2011 03:26
2 options for Windows PNG support Blue Baron Development 36 June 1, 2011 00:14


All times are GMT +1. The time now is 04:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.