Nitrogen Fingers Paint

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
m (Category)
(Format)
Line 15: Line 15:
 
== Format ==
 
== Format ==
  
The format consists of a text file containing a hex character for each pixel.
+
An NFP file consists of a text file containing a hex character for each pixel.
  
''TO-DO''
+
Each pixel's character must be in the range <abbr title="0123456789abcdef"><code>0-f</code></abbr> and be lowercase,
 +
any other characters (including capital <abbr title="ABCDEF"><code>A-F</code></abbr>) are treated as fully transparent pixels.
 +
 
 +
The newline (<code>\n</code>) character moves to the beginning of the next row.{{fix|End file with newline or not?}}
 +
Due to the nature of this, it is possible to have rows of different length and therefore means that nonsquare images can be created.
 +
 
 +
Whilst any unrecognised character is treaded as a transparent pixel, it is recommended that a space be used.
  
  
Line 28: Line 34:
 
|-
 
|-
 
|<code><pre>
 
|<code><pre>
         c
+
         c␤
   eeeeec
+
   eeeeec␤
   eeeeeee
+
   eeeeeee␤
  eeeeeeeee
+
  eeeeeeeee␤
   ccccccc
+
   ccccccc␤
   c33cc5c
+
   c33cc5c␤
   ccccc5c
+
   ccccc5c␤
fffffffffff
+
fffffffffff␤
 
</pre></code>
 
</pre></code>
 
''<code></code>
 
''<code></code>

Revision as of 14:06, 13 March 2021

File Format
Name NFP
Ontology
Extension(s) .nfp
Compression None
Reference Implementation CC:T's paintutils (lua)
Error Resilience None
NFP[Stands for?] is a simple text file format used by ComputerCraft to store images.

CraftOS's paint program allows for easy editing of these files with a GUI.


Format

An NFP file consists of a text file containing a hex character for each pixel.

Each pixel's character must be in the range 0-f and be lowercase, any other characters (including capital A-F) are treated as fully transparent pixels.

The newline (\n) character moves to the beginning of the next row.[End file with newline or not?] Due to the nature of this, it is possible to have rows of different length and therefore means that nonsquare images can be created.

Whilst any unrecognised character is treaded as a transparent pixel, it is recommended that a space be used.


Example

house.nfp
NFP PNG PNG (nonsquare)
        c␤
   eeeeec␤
  eeeeeee␤
 eeeeeeeee␤
  ccccccc␤
  c33cc5c␤
  ccccc5c␤
fffffffffff␤

NFP house.png NFP house nonsquare.png


External links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox