Jump to content

Transient Visitor

Level 1
  • Posts

  • Joined

  • Last visited

About Transient Visitor

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Transient Visitor's Achievements



  1. I can't reply to the topic in the developers forum, so I'll reply here. Sorry if necro-bumping is disapproved of, but this information might be useful to someone in the future. The extra information is stored in two chunks as defined by the PNG format specification (it's also detailed in the wikipedia article). These chunks are "skMf" and "skRf". The content of the skMf chunk is a description of the annotation (colours, fonts, position, text, etc.) encoded in JSON and stored as an uncompressed string. If you're on linux you can easily see this chunk by just using the "strings" command to print out all the printable characters in the png file. I've included the JSON from the example file you provided below: { "children": [ { "children": [ { "frame": { "height": 512, "width": 512, "x": 0, "y": 0 }, "guid": "CFA3CD9F-25B8-4B05-A0DE-9FC329D8252E", "imageProfile": 0, "type": "Bitmap", "uri": "skitch+uuid:///8a52cfa7-bd07-4fef-98ae-9440dd10b859" } ], "guid": "DC69298F-E3A1-4E8F-8B97-DC311E50F0D5", "layerId": "__background__", "type": "Layer" }, { "guid": "5B4F094F-7898-4652-803F-276BE349015C", "layerId": "__annotation__", "type": "Layer" }, { "children": [ { "alignment": "left", "direction": "leftToRight", "fillColor": { "alpha": 1, "blue": 255, "green": 255, "red": 255 }, "font": { "name": "Helvetica-Bold", "size": 24 }, "guid": "71E42721-ECC5-4F6E-BCAA-FF6753133A0F", "lineWidth": 6.720000000000001, "origin": { "x": 78.81640625, "y": 101.13953125 }, "strokeColor": { "alpha": 1, "blue": 0, "green": 0, "red": 0 }, "text": "how can I extract the position, size and content of this annotation?", "textStyle": "bubbleText", "type": "Text", "wrapWidth": 363.11328125 } ], "guid": "05BFB592-7B5F-4902-8FD9-AEF45B860F2B", "layerId": "__text__", "type": "Layer" } ], "contentScaleFactor": 1, "deviceScale": 1, "frame": { "height": 512, "width": 512, "x": 0, "y": 0 }, "guid": "8622A429-00E2-446B-9744-027D77B5088F", "metadata": { "creator": "skitch-mac", "creatorVersion": "452118", "version": "1.2" }, "type": "Document" } The skRf chunk is much, much larger and I believe it contains the raw image without annotations. I haven't tried to decode it, but I'd guess that it's encoded in the same way as the IDAT chunks containing the standard image data. The size of the skRf chunk is very similar to the total size of all the IDAT chunks. EDIT: It turns out the skRf chunk contains 16 bytes of unknown data, followed by an entire valid png file. If you dump the contents of the skRF chunk (minus those 16 bytes) to a file, it will open in any standard image viewer. This is the original un-annotated image.
  • Create New...