Skip to content

Commit 986ad11

Browse files
committed
Create README.md
1 parent c9d71e9 commit 986ad11

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Python-Spherical-Projection
2+
Convert cubemap image to an equirectangular spherical projection image using Python 2.7.
3+
4+
Currently only works with cubemaps laid out in the following format:
5+
6+
________
7+
| |
8+
| top |
9+
| |
10+
_______|________|_________________
11+
| | | | |
12+
| left | front | right | back |
13+
| | | | |
14+
|_______|________|________|________|
15+
| |
16+
| |
17+
| down |
18+
|________|
19+
20+
**Input Image**
21+
![input](https://github.com/adamb70/Python-Spherical-Projection/blob/master/Example/Example%201/input.jpg)
22+
23+
**Output Image**
24+
![output](https://github.com/adamb70/Python-Spherical-Projection/blob/master/Example/Example%201/output.jpg)
25+
26+
27+
## Instructions
28+
29+
* Open an image using PIL or equivalent.
30+
* Calculate dimensions of output image. (Width must be 2xheight. Height can be any percentage of input image, but larger output images lead to less precise results.)
31+
* Calculate length of each square face (ie. 1/3 height of the input, due to height being made from 3 faces - top,front,down)
32+
* Create an output image using the new dimensions.
33+
* For each pixel location in the output image run `cube2equi.find_corresponding_pixel()` to return the corresponding pixel in the input image.
34+
* Take the colour value for the input image pixel and apply it to the pixel in the output.
35+
36+
## TODO
37+
38+
* Automate all setup steps
39+
* Allow for different cubemap layouts

0 commit comments

Comments
 (0)