{"id":32829437,"url":"https://github.com/vitroid/tiffeditor","last_synced_at":"2025-11-07T19:03:43.169Z","repository":{"id":316427502,"uuid":"1061622685","full_name":"vitroid/tiffeditor","owner":"vitroid","description":"メモリ効率の良い巨大TIFF画像の部分編集ライブラリ","archived":false,"fork":false,"pushed_at":"2025-10-03T16:21:23.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T18:36:22.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitroid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-22T07:02:43.000Z","updated_at":"2025-10-03T16:21:26.000Z","dependencies_parsed_at":"2025-09-24T15:30:53.565Z","dependency_job_id":null,"html_url":"https://github.com/vitroid/tiffeditor","commit_stats":null,"previous_names":["vitroid/tiffeditor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vitroid/tiffeditor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Ftiffeditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Ftiffeditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Ftiffeditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Ftiffeditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitroid","download_url":"https://codeload.github.com/vitroid/tiffeditor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Ftiffeditor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283040271,"owners_count":26769189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-06T02:00:06.180Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-07T19:01:37.380Z","updated_at":"2025-11-07T19:03:43.159Z","avatar_url":"https://github.com/vitroid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TiffEditor\n\n\u003e **🚀 新しいリポジトリ**: より良い名前とクリーンな構造を持つ新しいホームへようこそ！\n\nメモリ効率の良い巨大 TIFF ファイルの部分編集を可能にする Python ライブラリです。\n\n## ✨ 主な特徴\n\n- 🚀 **メモリ効率**: メモリに乗らない巨大な TIFF ファイルでも部分的な読み書きが可能\n- 🔧 **タイル構造**: TIFF のタイル機能を活用した高速アクセス\n- 🎯 **スライス記法**: NumPy ライクなスライス記法でのデータアクセス\n- 📊 **データ整合性**: 読み書きの整合性チェック機能内蔵\n- 💾 **部分更新**: 既存ファイルの一部のみを効率的に更新可能\n- 🎨 **BGR 形式統一**: OpenCV（cv2）との完全互換\n- ⚡ **ScalableTiffEditor**: 仮想的な大画像操作でプロトタイプ開発を効率化\n\n## 📦 インストール\n\n### PyPI からインストール（推奨）\n\n```bash\npip install tiffeditor\n```\n\n### GitHub から直接インストール\n\n```bash\npip install git+https://github.com/vitroid/tiffeditor.git\n```\n\n### 開発環境セットアップ\n\n```bash\n# プロジェクトをクローン\ngit clone https://github.com/vitroid/tiffeditor.git\ncd tiffeditor\n\n# 依存関係をインストール（開発用）\nmake install-dev\n# または\npoetry install\n\n# 仮想環境をアクティブ化\npoetry shell\n```\n\n## 🚀 基本的な使用方法\n\n### 通常の TIFF 編集\n\n```python\nfrom tiffeditor import TiffEditor\nimport numpy as np\n\n# 新しいTIFFファイルを作成\nwith TiffEditor(\n    filepath=\"large_image.tiff\",\n    mode=\"w\",\n    shape=(10000, 10000, 3),  # 高さ×幅×チャンネル\n    dtype=np.uint8,\n    create_if_not_exists=True,\n) as editor:\n    # 部分的にデータを書き込み（BGR形式）\n    test_data = np.random.randint(0, 255, (1000, 1000, 3), dtype=np.uint8)\n    editor[1000:2000, 2000:3000] = test_data\n\n    print(f\"ファイル情報: {editor.get_info()}\")\n```\n\n### 仮想的な大画像操作 (ScalableTiffEditor)\n\n```python\nfrom tiffeditor import ScalableTiffEditor\nimport numpy as np\n\n# 仮想的に8000x6000の画像だが、実際は800x600で保存\nwith ScalableTiffEditor(\n    filepath=\"virtual_large.tiff\",\n    virtual_shape=(6000, 8000, 3),  # 仮想的なサイズ\n    scale_factor=0.1,                # 実際のサイズ = 仮想サイズ × 0.1\n    mode=\"w\",\n    dtype=np.uint8,\n    create_if_not_exists=True,\n) as editor:\n    # ユーザーは大きな座標で操作\n    test_data = np.zeros((1000, 1000, 3), dtype=np.uint8)\n    test_data[:, :, 2] = 255  # BGR形式で赤色\n\n    # 仮想座標で書き込み（実際には100x100にリサイズされて保存）\n    editor[1000:2000, 1500:2500] = test_data\n\n    # 仮想座標で読み込み（実際のデータが1000x1000にリサイズされて返される）\n    read_data = editor[1000:2000, 1500:2500]\n    print(f\"読み込んだデータの形状: {read_data.shape}\")  # (1000, 1000, 3)\n```\n\n## 🎯 主要クラス\n\n### `TiffEditor`\n\nメインクラス。BGR 形式で TIFF ファイルの読み書きを担当。OpenCV（cv2）との完全互換。\n\n### `ScalableTiffEditor`\n\n仮想的に大きな画像を扱いながら、実際には縮小されたファイルで操作を行う拡張クラス。\n\n**主要な特徴:**\n\n- 仮想座標系での操作\n- 自動的なスケーリング（拡大・縮小）\n- メモリ効率の大幅改善\n- 透明な座標変換\n\n## 🔧 テストと開発\n\n### クイックテスト\n\n```bash\n# 使用例を実行\npython example_usage.py\n\n# 基本的なエディタテスト\npython tiffeditor.py test_editor\n\n# ScalableTiffEditorのテスト\npython tiffeditor.py test_scalable\n\n# メモリ効率テスト（大容量ファイル）\npython tiffeditor.py large_test\n```\n\n### 開発者向け Make コマンド\n\n```bash\n# ヘルプを表示\nmake help\n\n# 全チェック実行（フォーマット + lint + 型チェック + テスト）\nmake all-checks\n\n# コミット前チェック\nmake pre-commit\n\n# パッケージビルド\nmake build\n\n# TestPyPIにアップロード\nmake upload-test\n\n# 本番PyPIにアップロード\nmake upload\n```\n\n## 📈 パフォーマンス\n\n**メモリに乗らないサイズ（6.47GB）のファイルを、わずか 1.31GB のメモリで処理！**\n\n```\nINFO: 利用可能メモリ: 4.24 GB\nINFO: 作成予定サイズ: 47717x47717x3\nINFO: 予想ファイルサイズ: 6.36 GB\nINFO: 実際のファイルサイズ: 6.47 GB\nINFO: メモリ使用量変化: 52.8MB -\u003e 1311.8MB\nINFO: ✅ 大きなTIFFファイルの作成・整合性チェックが成功しました！\n```\n\n## 🏗️ 技術仕様\n\n- **依存関係**: numpy, rasterio, tifffile, opencv-python\n- **対応形式**: タイル化 TIFF（Tiled TIFF）\n- **データ型**: uint8, uint16, float32 など（NumPy 対応型）\n- **色形式**: BGR（OpenCV 互換）\n- **最大ファイルサイズ**: システムディスク容量に依存\n\n## 🔄 移行ガイド\n\n### 既存の `rasterio_tiff` からの移行\n\n```python\n# 旧: rasterio_tiff\nfrom rasterio_tiff import TiffEditor\n\n# 新: tiffeditor\nfrom tiffeditor import TiffEditor\n\n# API は 100% 互換！追加コードは必要ありません\n```\n\n## 📄 ライセンス\n\nMIT License\n\n## 🤝 コントリビューション\n\nIssue や Pull Request を歓迎します！\n\n---\n\n**注意**: BGR 形式での統一により、OpenCV（cv2）との混在利用が完全に安全になりました。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitroid%2Ftiffeditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitroid%2Ftiffeditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitroid%2Ftiffeditor/lists"}