Skip to content

Commit a6bc2d0

Browse files
committed
reformat *.md + update deps
1 parent 22907ce commit a6bc2d0

File tree

5 files changed

+83
-50
lines changed

5 files changed

+83
-50
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
23
All major and minor version changes will be documented in this file. Details of
34
patch-level version changes can be found in [commit messages](../../commits/master).
45

LAYERED_SPEC.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# .layered
2+
23
.layered is highly inspired by the open raster format and aims to provide an
34
exchange format in the cases when saving in ora would cause unacceptable data
45
loss. .layered has been designed so that if the format became deprecated and no
56
readers existed for it tomorrow, the data would be easily salvageable.
67

7-
88
## Rationale
9+
910
.ora is sufficient for the vast majority of layered images that are represented
1011
by this library and should be used where possible. However, some blending
1112
functions that are present in other formats such as xcf and psd are unable to
1213
be stored in .ora. Meaning that yet another file format is required.
1314

1415
Ora supports the following blend modes:
16+
1517
```none
1618
NORMAL
1719
MULTIPLY
@@ -37,6 +39,7 @@ SRCATOP
3739
```
3840

3941
## When to use .layered
42+
4043
Ideally .layered should only be used when it is not possible to store the
4144
layered image in another format that is more readily exchangeable due to
4245
unacceptable data loss. .layered has been designed so that if the format
@@ -60,16 +63,19 @@ EXCLUSION
6063
```
6164

6265
## Advantages
66+
6367
.layered is able to store blend modes that cannot be stored in an open raster
6468
image or other formats.
6569

6670
## Drawbacks
71+
6772
This is another format in a sea of formats and is only recommended to be used
6873
where it is not possible to use another format for this reason. Graphics editor
6974
support for .layered is unlikely unless this became an extremely popular format
7075
which given the existence of ora isn't very likely.
7176

7277
## Versions
78+
7379
From 2020.2 to 2020.6 the only changes in the layered image object has been the
7480
addition of more blending modes. Other elements have remained the same (2020.2
7581
added blend modes and so there was a change to support these). Therefore,
@@ -78,8 +84,8 @@ spec shouldn't change
7884

7985
### 2020
8086

81-
8287
## Structure
88+
8389
Based very heavily upon the open raster specification. A .layered file is
8490
basically a zip file containing data on the layers and groups such as the name,
8591
offsets, the images stored as png and a composite image that can be extracted
@@ -95,27 +101,35 @@ example.layered
95101
```
96102

97103
## Required files
104+
98105
The files except for composite.png are required though composite.png is
99106
highly recommended to be included
100107

101108
### stack.json
109+
102110
stack.json contains all text data on a layer or group such as the name,
103111
dimensions and offsets.
104112

105113
#### Why json?
114+
106115
Json has been used as it is supported as part of a core python installation.
107116
A large number of json parsers are available. It is used by the likes of
108117
GraphQl. It's good enough for Apple LSR.
109118

110119
### data/\[layername\].png
120+
111121
Layer image data should be stored here.
112122

113123
## Optional files
124+
114125
### composite.png
126+
115127
Composite image that can be extracted by file managers/ viewers. This must
116128
be representative of the .layered image for example hidden layers are not shown
117129
as part of this image.
130+
118131
### thumbnail.png
132+
119133
Composite image that can be extracted by file managers/ viewers. This must
120134
be representative of the .layered image for example hidden layers are not shown
121135
as part of this image and have a maximum size of 256x256 pixels.
@@ -137,10 +151,12 @@ example.ora [considered as a folder-like object]
137151
```
138152

139153
### Similarities
154+
140155
The file format is essentially a list of images, a composite image and a file
141156
containing information on the layers and groups (name, size, offsets)
142157

143158
### Differences
159+
144160
.layered lacks the mimetype. This is because the file type can
145161
and should be determined from the extension for .layered
146162

@@ -151,16 +167,17 @@ Json is used instead of xml.
151167

152168
The thumbnail is in the root directory as multiple thumbnails are not planned.
153169

154-
155170
## Stack data
156171

157172
### Image
173+
158174
```none
159175
dimensions: (int, int)
160176
layersAndGroups: [layer|group]
161177
```
162178

163179
### Group
180+
164181
```none
165182
name: string
166183
offsets: (int, int)
@@ -173,6 +190,7 @@ layers: [layer]
173190
```
174191

175192
### Layer
193+
176194
```none
177195
name: string
178196
offsets: (int, int)
@@ -187,12 +205,14 @@ image: PIL.Image
187205
Consider an image that has the following structure:
188206

189207
Bottom layer
208+
190209
```none
191210
Group ("group_0")
192211
Layer("layer_0")
193212
Layer("layer_1")
194213
Layer("layer_2")
195214
```
215+
196216
Top Layer
197217

198218
The stack.json would look something like this:
@@ -211,11 +231,12 @@ The stack.json would look something like this:
211231
"dimensions": [250, 250], "type": "LAYER", "blendmode": "NORMAL"}]}
212232
```
213233

214-
215234
## .layeredc
235+
216236
This is a compressed version of the layered format.
217237

218238
Changes:
239+
219240
- The .zip file is compressed with 'deflate'
220241
- .PNGs are quantized where possible
221242
- stack.json is minified

README.md

+50-38
Original file line numberDiff line numberDiff line change
@@ -68,67 +68,68 @@ the case, please open an issue and I will fix the tables.
6868
- :x: - This is not supported and will cause loss of data
6969
- N/A - The source format does not support this so treat this as a :heavy_check_mark:
7070

71-
|Format|.ora|.pdn|.xcf|.psd|.tiff/ .tif|.webp|.gif|.lsr|
72-
|------|----|----|----|----|-----|----|-----|----|
73-
|Read |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|
74-
|Layers|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|
75-
|Groups|:heavy_check_mark:|N/A |:heavy_check_mark:|:heavy_check_mark:|N/A|N/A|N/A|:heavy_check_mark:|
76-
|Write |:heavy_check_mark:|:x: |:x: |:x: |:warning:|:warning:|:warning:|:heavy_check_mark:|
71+
| Format | .ora | .pdn | .xcf | .psd | .tiff/ .tif | .webp | .gif | .lsr |
72+
| ------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
73+
| Read | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
74+
| Layers | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
75+
| Groups | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | :heavy_check_mark: |
76+
| Write | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :heavy_check_mark: |
7777

7878
#### Reading - Group
7979

80-
|Format |.ora|.pdn|.xcf|.psd|.tiff/ .tif|.webp|.gif|.lsr|
81-
|----------|----|----|----|----|-----|----|-----|----|
82-
|Name |:heavy_check_mark:|N/A |:heavy_check_mark:|:heavy_check_mark:|N/A |N/A |N/A |:heavy_check_mark:|
83-
|Dimensions|:warning:|N/A |:heavy_check_mark:|:heavy_check_mark:|N/A |N/A |N/A |:heavy_check_mark:|
84-
|Offsets |:heavy_check_mark:|N/A |:heavy_check_mark:|:heavy_check_mark:|N/A |N/A |N/A |:heavy_check_mark:|
85-
|Opacity |:heavy_check_mark:|N/A |:heavy_check_mark:|:heavy_check_mark:|N/A |N/A |N/A |N/A |
86-
|Visibility|:heavy_check_mark:|N/A |:heavy_check_mark: |:heavy_check_mark:|N/A |N/A |N/A |N/A |
87-
|Blend Mode|:heavy_check_mark:|N/A |:heavy_check_mark:|:heavy_check_mark:|N/A|N/A |N/A |N/A |
80+
| Format | .ora | .pdn | .xcf | .psd | .tiff/ .tif | .webp | .gif | .lsr |
81+
| ---------- | ------------------ | ---- | ------------------ | ------------------ | ----------- | ----- | ---- | ------------------ |
82+
| Name | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | :heavy_check_mark: |
83+
| Dimensions | :warning: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | :heavy_check_mark: |
84+
| Offsets | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | :heavy_check_mark: |
85+
| Opacity | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | N/A |
86+
| Visibility | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | N/A |
87+
| Blend Mode | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | N/A |
8888

8989
#### Reading - Layer
9090

91-
|Format |.ora|.pdn|.xcf|.psd|.tiff/ .tif|.webp|.gif|.lsr|
92-
|----------|----|----|----|----|-----|----|-----|----|
93-
|Name |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:warning:|:warning:|:heavy_check_mark:|
94-
|Dimensions|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|
95-
|Offsets |:heavy_check_mark:|N/A |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|N/A|N/A|N/A |
96-
|Opacity |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|N/A |N/A |N/A |N/A |
97-
|Visibility|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: |:heavy_check_mark:|N/A |N/A |N/A |N/A |
98-
|Blend Mode|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|N/A|N/A |N/A |N/A |
91+
| Format | .ora | .pdn | .xcf | .psd | .tiff/ .tif | .webp | .gif | .lsr |
92+
| ---------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
93+
| Name | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :warning: | :warning: | :heavy_check_mark: |
94+
| Dimensions | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
95+
| Offsets | :heavy_check_mark: | N/A | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A |
96+
| Opacity | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | N/A |
97+
| Visibility | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | N/A |
98+
| Blend Mode | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | N/A | N/A |
9999

100100
#### Writing - Group
101101

102-
|Format |.ora|.pdn|.xcf|.psd|.tiff/ .tif|.webp|.gif|.lsr|
103-
|----------|----|----|----|----|-----|----|-----|----|
104-
|Name |:heavy_check_mark:|:x:|:x:|:x:|:x:|:x:|:x:|:heavy_check_mark:|
105-
|Dimensions|:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:heavy_check_mark:|
106-
|Offsets |:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:heavy_check_mark:|
107-
|Opacity |:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:warning:|
108-
|Visibility|:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:warning:|
109-
|Blend Mode|:heavy_check_mark:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|
102+
| Format | .ora | .pdn | .xcf | .psd | .tiff/ .tif | .webp | .gif | .lsr |
103+
| ---------- | ------------------ | ---- | ---- | ---- | ----------- | --------- | --------- | ------------------ |
104+
| Name | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :heavy_check_mark: |
105+
| Dimensions | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :heavy_check_mark: |
106+
| Offsets | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :heavy_check_mark: |
107+
| Opacity | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :warning: |
108+
| Visibility | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :warning: |
109+
| Blend Mode | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
110110

111111
```none
112112
Layers are extracted from groups and saved to TIFF/ GIF or WEBP
113113
```
114114

115115
#### Writing - Layer
116116

117-
|Format |.ora|.pdn|.xcf|.psd|.tiff/ .tif|.webp|.gif|.lsr|
118-
|----------|----|----|----|----|-----|----|-----|----|
119-
|Name |:heavy_check_mark:|:x:|:x:|:x:|:x:|:x:|:x:|:warning:|
120-
|Dimensions|:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:warning:|
121-
|Offsets |:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:warning:|
122-
|Opacity |:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:warning:|
123-
|Visibility|:heavy_check_mark:|:x:|:x:|:x:|:warning:|:warning:|:warning:|:warning:|
124-
|Blend Mode|:heavy_check_mark:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|
117+
| Format | .ora | .pdn | .xcf | .psd | .tiff/ .tif | .webp | .gif | .lsr |
118+
| ---------- | ------------------ | ---- | ---- | ---- | ----------- | --------- | --------- | --------- |
119+
| Name | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :warning: |
120+
| Dimensions | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :warning: |
121+
| Offsets | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :warning: |
122+
| Opacity | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :warning: |
123+
| Visibility | :heavy_check_mark: | :x: | :x: | :x: | :warning: | :warning: | :warning: | :warning: |
124+
| Blend Mode | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
125125

126126
```none
127127
Layers are rendered with offsets before being written to TIFF/ GIF or WEBP
128128
First child layers are placed in a group when written to LSR
129129
```
130130

131131
## .layered
132+
132133
.layered is highly inspired by the open raster format and aims to provide an
133134
exchange format in the cases when saving in ora would cause unacceptable data
134135
loss. .layered has been designed so that if the format became deprecated and no
@@ -221,6 +222,7 @@ tiff.getFlattenLayers().save(THISDIR + "/base24(tiff).png")
221222
```
222223

223224
## Documentation
225+
224226
See the [Docs](/DOCS/) for more information.
225227

226228
## Install With PIP
@@ -234,6 +236,7 @@ Head to https://pypi.org/project/layeredimage/ for more info
234236
## Language information
235237

236238
### Built for
239+
237240
This program has been written for Python versions 3.7 - 3.10 and has been tested with both 3.7 and
238241
3.10
239242

@@ -246,6 +249,7 @@ choco install python
246249
```
247250

248251
### Windows - Python.org
252+
249253
To install Python, go to https://www.python.org/downloads/windows/ and download the latest
250254
version.
251255

@@ -272,6 +276,7 @@ brew install [email protected]
272276
```
273277

274278
### MacOS - Python.org
279+
275280
To install Python, go to https://www.python.org/downloads/macos/ and download the latest
276281
version.
277282

@@ -330,38 +335,45 @@ https://help.github.com/en/desktop/contributing-to-projects/cloning-a-repository
330335
## Community Files
331336

332337
### Licence
338+
333339
MIT License
334340
Copyright (c) FredHappyface
335341
(See the [LICENSE](/LICENSE.md) for more information.)
336342

337343
### Changelog
344+
338345
See the [Changelog](/CHANGELOG.md) for more information.
339346

340347
### Code of Conduct
348+
341349
Online communities include people from many backgrounds. The *Project*
342350
contributors are committed to providing a friendly, safe and welcoming
343351
environment for all. Please see the
344352
[Code of Conduct](https://github.com/FHPythonUtils/.github/blob/master/CODE_OF_CONDUCT.md)
345353
for more information.
346354

347355
### Contributing
356+
348357
Contributions are welcome, please see the
349358
[Contributing Guidelines](https://github.com/FHPythonUtils/.github/blob/master/CONTRIBUTING.md)
350359
for more information.
351360

352361
### Security
362+
353363
Thank you for improving the security of the project, please see the
354364
[Security Policy](https://github.com/FHPythonUtils/.github/blob/master/SECURITY.md)
355365
for more information.
356366

357367
### Support
368+
358369
Thank you for using this project, I hope it is of use to you. Please be aware that
359370
those involved with the project often do so for fun along with other commitments
360371
(such as work, family, etc). Please see the
361372
[Support Policy](https://github.com/FHPythonUtils/.github/blob/master/SUPPORT.md)
362373
for more information.
363374

364375
### Rationale
376+
365377
The rationale acts as a guide to various processes regarding projects such as
366378
the versioning scheme and the programming styles used. Please see the
367379
[Rationale](https://github.com/FHPythonUtils/.github/blob/master/RATIONALE.md)

pyproject.toml

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ readme = "README.md"
2323

2424
[tool.poetry.dependencies]
2525
python = "^3.7"
26-
blendmodes = "<2023,>=2021.3"
26+
blendmodes = "<2023,>=2021.3.3"
2727
metprint = "<2022,>=2020.7.1"
28-
Pillow = "<9,>=8.3.2"
28+
Pillow = "<9,>=8.4.0"
2929
pylsr = "<2023,>=2021.0.1"
3030
pyora = "<2,>=0.3.11"
31-
gimpformats = "<2023,>=2021.1.1"
31+
gimpformats = "<2023,>=2021.1.2"
3232
psdtoolsx = "<20,>=19.5.0"
3333
pypdn = "<2,>=1.0.6"
3434
deprecation = "<3,>=2.1.0"
@@ -59,8 +59,7 @@ disable = [
5959
"not-callable", # Bug with 'LayeredImage is not callable (not-callable)'
6060
"pointless-string-statement",
6161
"superfluous-parens",
62-
"bad-continuation",
63-
"python3",
62+
"bad-continuation"
6463
]
6564

6665
[tool.black]

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Pillow<9,>=8.3.2
2-
blendmodes<2023,>=2021.3
1+
Pillow<9,>=8.4.0
2+
blendmodes<2023,>=2021.3.3
33
deprecation<3,>=2.1.0
4-
gimpformats<2023,>=2021.1.1
4+
gimpformats<2023,>=2021.1.2
55
metprint<2022,>=2020.7.1
66
psdtoolsx<20,>=19.5.0
77
pylsr<2023,>=2021.0.1

0 commit comments

Comments
 (0)