tiledimage 0.3__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.1
2
+ Name: tiledimage
3
+ Version: 0.3.1
4
+ Summary: tools for tiled image that can be cached on a filesystem.
5
+ License: MIT
6
+ Author: vitroid
7
+ Author-email: vitroid@gmail.com
8
+ Requires-Python: >=3.10,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Dist: opencv-python-headless (>=4.11.0.86,<5.0.0.0)
15
+ Requires-Dist: pylru (>=1.2.1,<2.0.0)
16
+ Description-Content-Type: text/markdown
17
+
18
+ #TiledImage
19
+ This provides tools for tiled image that can be cached on a filesystem.
20
+
21
+ It is developed to reduce the memory usage when handling an image that is too huge to show all at a time.
22
+ It is developed for the [TrainScanner](https://github.com/vitroid/TrainScanner).
23
+
@@ -0,0 +1,5 @@
1
+ #TiledImage
2
+ This provides tools for tiled image that can be cached on a filesystem.
3
+
4
+ It is developed to reduce the memory usage when handling an image that is too huge to show all at a time.
5
+ It is developed for the [TrainScanner](https://github.com/vitroid/TrainScanner).
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "tiledimage"
3
- version = "0.3"
3
+ version = "0.3.1"
4
4
  description = "tools for tiled image that can be cached on a filesystem."
5
5
  authors = ["vitroid <vitroid@gmail.com>"]
6
6
  license = "MIT"
@@ -94,8 +94,5 @@ class CachedImage(TiledImage):
94
94
  )
95
95
  self.tiles.adjust_cache_size()
96
96
 
97
- def _set_hook(self, hook):
98
- """
99
- 内部実装用:タイル書き換え時のフック関数を設定
100
- """
97
+ def set_hook(self, hook):
101
98
  self.tiles.set_hook(hook)
tiledimage-0.3/PKG-INFO DELETED
@@ -1,149 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tiledimage
3
- Version: 0.3
4
- Summary: tools for tiled image that can be cached on a filesystem.
5
- License: MIT
6
- Author: vitroid
7
- Author-email: vitroid@gmail.com
8
- Requires-Python: >=3.10,<4.0
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Requires-Dist: opencv-python-headless (>=4.11.0.86,<5.0.0.0)
15
- Requires-Dist: pylru (>=1.2.1,<2.0.0)
16
- Description-Content-Type: text/markdown
17
-
18
- # TiledImage
19
-
20
- 大きな画像を効率的に扱うための Python ライブラリです。メモリ使用量を抑えながら、大きな画像をタイル(小さな断片)に分割して管理します。
21
-
22
- ## 特徴
23
-
24
- - 大きな画像をタイルに分割して管理
25
- - ファイルシステム上でのキャッシュ機能
26
- - メモリ効率の良い画像処理
27
- - コンテキストマネージャ(`with`文)による簡単な使用
28
-
29
- ## インストール
30
-
31
- ```bash
32
- pip install tiledimage
33
- ```
34
-
35
- ## 基本的な使い方
36
-
37
- ### 画像の分割(PNG → PNGs)
38
-
39
- ```python
40
- from tiledimage import CachedImage
41
- import cv2
42
-
43
- # 画像を読み込み
44
- img = cv2.imread("large_image.png")
45
-
46
- # タイル化して保存
47
- with CachedImage(
48
- mode="new",
49
- dir="output.pngs",
50
- tilesize=(64, 64),
51
- cachesize=10,
52
- bgcolor=(255, 255, 255), # 背景色(白)
53
- fileext="jpg"
54
- ) as tiled:
55
- tiled.put_image((0, 0), img) # 画像を配置
56
- ```
57
-
58
- ### 画像の結合(PNGs → PNG)
59
-
60
- ```python
61
- from tiledimage import CachedImage
62
- import cv2
63
-
64
- # タイル化された画像を読み込み
65
- with CachedImage(mode="inherit", dir="input.pngs") as tiled:
66
- # 全体の画像を取得
67
- full_image = tiled.get_image()
68
- # 保存
69
- cv2.imwrite("combined_image.png", full_image)
70
- ```
71
-
72
- ### コマンドラインツール
73
-
74
- 画像の分割:
75
-
76
- ```bash
77
- pngs2 input.png output.pngs
78
- ```
79
-
80
- 画像の結合:
81
-
82
- ```bash
83
- 2pngs input.pngs output.png
84
- ```
85
-
86
- ## API リファレンス
87
-
88
- ### CachedImage
89
-
90
- メインのクラス。タイル化された画像を管理します。
91
-
92
- ```python
93
- CachedImage(
94
- mode, # "new" または "inherit"
95
- dir="image.pngs", # タイルの保存ディレクトリ
96
- tilesize=128, # タイルのサイズ(整数またはタプル)
97
- cachesize=10, # キャッシュサイズ
98
- fileext="png", # タイルのファイル形式
99
- bgcolor=(0,0,0), # 背景色
100
- hook=None, # タイル書き換え時のフック関数
101
- disposal=False # 終了時にディレクトリを削除するか
102
- )
103
- ```
104
-
105
- #### 主要メソッド
106
-
107
- - `put_image(pos, img, linear_alpha=None)`: 画像を配置
108
- - `get_image()`: 全体の画像を取得
109
- - `write_info()`: 情報を保存(通常は自動的に呼ばれる)
110
-
111
- ### TiledImage
112
-
113
- 基本的なタイル画像クラス。キャッシュ機能はありません。
114
-
115
- ```python
116
- TiledImage(
117
- tilesize=128, # タイルのサイズ
118
- bgcolor=(100,100,100) # 背景色
119
- )
120
- ```
121
-
122
- ## 開発者向け情報
123
-
124
- ### テスト
125
-
126
- ```bash
127
- make test
128
- ```
129
-
130
- ### ビルド
131
-
132
- ```bash
133
- make build
134
- ```
135
-
136
- ### デプロイ
137
-
138
- ```bash
139
- make deploy
140
- ```
141
-
142
- ## ライセンス
143
-
144
- MIT License
145
-
146
- ## 作者
147
-
148
- Masakazu Matsumoto (vitroid@gmail.com)
149
-
tiledimage-0.3/README.md DELETED
@@ -1,131 +0,0 @@
1
- # TiledImage
2
-
3
- 大きな画像を効率的に扱うための Python ライブラリです。メモリ使用量を抑えながら、大きな画像をタイル(小さな断片)に分割して管理します。
4
-
5
- ## 特徴
6
-
7
- - 大きな画像をタイルに分割して管理
8
- - ファイルシステム上でのキャッシュ機能
9
- - メモリ効率の良い画像処理
10
- - コンテキストマネージャ(`with`文)による簡単な使用
11
-
12
- ## インストール
13
-
14
- ```bash
15
- pip install tiledimage
16
- ```
17
-
18
- ## 基本的な使い方
19
-
20
- ### 画像の分割(PNG → PNGs)
21
-
22
- ```python
23
- from tiledimage import CachedImage
24
- import cv2
25
-
26
- # 画像を読み込み
27
- img = cv2.imread("large_image.png")
28
-
29
- # タイル化して保存
30
- with CachedImage(
31
- mode="new",
32
- dir="output.pngs",
33
- tilesize=(64, 64),
34
- cachesize=10,
35
- bgcolor=(255, 255, 255), # 背景色(白)
36
- fileext="jpg"
37
- ) as tiled:
38
- tiled.put_image((0, 0), img) # 画像を配置
39
- ```
40
-
41
- ### 画像の結合(PNGs → PNG)
42
-
43
- ```python
44
- from tiledimage import CachedImage
45
- import cv2
46
-
47
- # タイル化された画像を読み込み
48
- with CachedImage(mode="inherit", dir="input.pngs") as tiled:
49
- # 全体の画像を取得
50
- full_image = tiled.get_image()
51
- # 保存
52
- cv2.imwrite("combined_image.png", full_image)
53
- ```
54
-
55
- ### コマンドラインツール
56
-
57
- 画像の分割:
58
-
59
- ```bash
60
- pngs2 input.png output.pngs
61
- ```
62
-
63
- 画像の結合:
64
-
65
- ```bash
66
- 2pngs input.pngs output.png
67
- ```
68
-
69
- ## API リファレンス
70
-
71
- ### CachedImage
72
-
73
- メインのクラス。タイル化された画像を管理します。
74
-
75
- ```python
76
- CachedImage(
77
- mode, # "new" または "inherit"
78
- dir="image.pngs", # タイルの保存ディレクトリ
79
- tilesize=128, # タイルのサイズ(整数またはタプル)
80
- cachesize=10, # キャッシュサイズ
81
- fileext="png", # タイルのファイル形式
82
- bgcolor=(0,0,0), # 背景色
83
- hook=None, # タイル書き換え時のフック関数
84
- disposal=False # 終了時にディレクトリを削除するか
85
- )
86
- ```
87
-
88
- #### 主要メソッド
89
-
90
- - `put_image(pos, img, linear_alpha=None)`: 画像を配置
91
- - `get_image()`: 全体の画像を取得
92
- - `write_info()`: 情報を保存(通常は自動的に呼ばれる)
93
-
94
- ### TiledImage
95
-
96
- 基本的なタイル画像クラス。キャッシュ機能はありません。
97
-
98
- ```python
99
- TiledImage(
100
- tilesize=128, # タイルのサイズ
101
- bgcolor=(100,100,100) # 背景色
102
- )
103
- ```
104
-
105
- ## 開発者向け情報
106
-
107
- ### テスト
108
-
109
- ```bash
110
- make test
111
- ```
112
-
113
- ### ビルド
114
-
115
- ```bash
116
- make build
117
- ```
118
-
119
- ### デプロイ
120
-
121
- ```bash
122
- make deploy
123
- ```
124
-
125
- ## ライセンス
126
-
127
- MIT License
128
-
129
- ## 作者
130
-
131
- Masakazu Matsumoto (vitroid@gmail.com)
File without changes
File without changes