# PictureFan XNvgdl


## ͂߂

PictureFan ł Python ɂXNvggpďsƂł܂B  
݂̎dl͎bIȂ̂ł̂ŁAύX\܂B

̕ Markdown (CommonMark) gpĂ܂̂ŁAMarkdown r[A𗘗pΌ₷Ȃ܂B


## Tv

XNvgj[sł悤ɂ邽߂ɂ́APython ̃XNvgt@C(*.py)
XNvgtH_(ftHgł .\Scripts)̏̃TutH_ɔzu܂B

* Main  
  CEBhEpXNvg
* Thumbnails  
  TlCpXNvg
* Viewer  
  Pƃr[A

΁ACEBhEyуTlC̃j[ [c[] -> [XNvg] Ŏsł悤ɂȂ܂B

.\Python tH_ Python ̎s܂܂Ă܂A͈ȉ Python TCgŌJĂ
ߍݗps̃t@C(embeddable zip file)ƑŜłB

[Python Releases for Windows](https://www.python.org/downloads/windows/)

Python ͂ł Windows 7 ̃T|[gł؂Ă܂APictureFan  Windows 7 Ɋ܂߂Ă邽߁AYt Python  3.8 ɂȂĂ܂B
Python 3.6 ȍ~ł΃o[WXVAɂg̊ Python CXg[Ă΂𗘗p邱Ƃł܂B
APictureFan  x86 ł̏ꍇ Python  x86 łKvłA
l PictureFan  x64 ł̏ꍇ x64 ł Python CXg[ĂKv܂B

 Python 𗘗pꍇ́AUsers.ini t@C PythonDir Őݒ肵܂B
ݒ@ɊւĂ Users.sample.ini t@CQƂĂB


### pip ̗p

t Python s͖ߍݗp̊ł邽߁Apip ܂܂Ă܂B  
pip 𗘗pɂ́A܂ Python tH_ python38._pth t@C̈ȉ̍s̐擪 # 폜ĂB

~~~
#import site
~~~

get-pip.py  https://bootstrap.pypa.io/get-pip.py _E[h Python tH_ɔzuAȉ̂悤Ɏs܂B

~~~
python get-pip.py
~~~

̂܂܂ł̓JgfBNgɃpXʂȂ߁ApbP[WɂĂ̓CXg[ł܂B  
̂߁APython tH_ current.pth t@C쐬(gq .pth ł΃t@C͈قȂĂ悢)Aȉ̓eLq܂B

~~~
import sys; sys.path.append('')
~~~

pbP[W̃CXg[͈ȉ̂悤ɍs܂B

~~~
python -m pip install numpy
~~~


### XNvg̏

ʏ Python Ɠlɏ܂B  
t@C̃GR[fBO UTF-8 ɂĂB

PictureFan Ɋ֌W@\́AW[ `PictureFan` ɂ܂̂ŁAimport ĂB

~~~
import PictureFan as PF

app = PF.Application()
app.alert("Hello, World.")
~~~


## NXdl

`PictureFan` W[̈ȉ̃NXpł܂B

* [Application](#Application-NX)  
  vOS
* [WindowBase](#WindowBase-NX)  
  EBhE̊NX
* [MainWindow](#MainWindow-NX)  
  CEBhE
* [Image](#Image-NX)  
  摜
* [ImageFilter](#ImageFilter-NX)  
  摜tB^
* [Color](#Color-NX)  
  F
* [Palette](#Palette-NX)  
  pbg
* [Rectangle](#Rectangle-NX)  
  `
* [Matrix](#Matrix-NX)  
  s
* [Document](#Document-NX)  
  hLg
* [Viewer](#Viewer-NX)  
  Pƃr[A
* [PopupMenu](#PopupMenu-NX)  
  |bvAbvj[
* [ThumbnailsWindow](#ThumbnailsWindow-NX)  
  TlCEBhE
* [ThumbnailsFolder](#ThumbnailsFolder-NX)  
  TlCtH_
* [ThumbnailsFile](#ThumbnailsFile-NX)  
  TlCt@C


### Application NX

AvP[V̑S̓IȎɊւNXłB

#### Application.version : str (read only)

PictureFan ̃o[WłB"0.37.0" ̂悤ȕłB

#### Application.run_context : str (read only)

XNvgǂ̂悤Ɏsꂽ\܂Bȉ̂ꂩłB

* "Application"  
  AvP[ṼCxgsꂽ

* "Batch"  
  ꊇϊsꂽ

* "MainWindow"  
  CEBhEsꂽ

* "Thumbnails"  
  TlCEBhEsꂽ

* "Viewer"  
  Pƃr[Asꂽ

#### Application.run_event : str (read only)

CxgŃXNvgsꂽꍇÃCxg\܂B  
Cxgsꂽ̂łȂ `None` ɂȂ܂B

* "Application.Start"  
  Av[V̊Jn

* "Application.End"  
  AvP[V̏I

* "MainWindow.Open"  
  CEBhE̕\

* "MainWindow.Close"  
  CEBhE

* "Document.Open"  
  hLgJ

* "Document.Close"  
  hLg

* "Document.FileChange"  
  hLg̃t@C؂ւ

* "Thumbnails.Open"  
  TlCJ

* "Thumbnails.Close"  
  TlC

* "Viewer.Open"  
  Pƃr[AJ

* "Viewer.Close"  
  Pƃr[A

* "Viewer.FileChange"  
  Pƃr[Ãt@C؂ւ

#### Application.alert(message: str, caption: str = "", type: AlertType = AlertType.INFORMATION)

_CAOŃbZ[W\܂B

* `message`  
  \郁bZ[W̕łB

* `caption`  
  LvV̕łBȗ "Alert" ɂȂ܂B

* `type`  
  \郁bZ[W̎ނłB

  * `AlertType.INFORMATION`  
    
  * `AlertType.WARNING`  
    x
  * `AlertType.ERROR`  
    G[

#### Application.confirm(message: str, caption: str = "") -> bool

[͂]  [] {^̂A₢킹̃_CAO\܂B

* `message`  
  \郁bZ[W̕łB

* `caption`  
  LvV̕łBȗ "₢킹" ɂȂ܂B

* ߂l  
  [͂] Iꂽꍇ `True` AȊȌꍇ `False` Ԃ܂B

#### Application.prompt(message: str, caption: str = "", default_value: str = "") -> str

s͂̕_CAO\܂B

* `message`  
  \郁bZ[WłB

* `caption`  
  LvV̕łBȗ "" ɂȂ܂B

* `default_value`  
  ftHgœ͂镶w肵܂BȗƋɂȂ܂B

* ߂l  
  ͂ꂽ񂪕Ԃ܂B
  LZꂽꍇ `None` Ԃ܂B

* 
  ~~~
  app = PictureFan.Application()
  input = app.prompt("͂Ă")
  if input is not None:
      app.alert(input + "Ɠ͂܂")
  ~~~

#### Application.open_dialog(filename: str, caption: str = "") -> str

t@CJ_CAO\܂B

* `filename`  
  ftHg̃t@Cw肵܂Bȗꍇ͋ɂȂ܂B
  pX܂߂ƁÃtH_ŏɕ\܂B
  tH_݂̂̎wɂꍇ \ ŏI[܂B

* `caption`  
  LvV̕w肵܂Bȗꍇ̓ftHgɂȂ܂B

* ߂l  
  Iꂽt@C̃pXԂ܂B
  LZꂽꍇ `None` Ԃ܂B

*   
  ~~~
  app = PictureFan.Application()
  path = app.open_dialog()
  if path is not None:
      app.open_document(path)
  ~~~

#### Application.choose_folder(folder: str, message: str = "") -> str

tH_I_CAO\܂B

* `folder`  
  ftHgőItH_w肵܂B
  ȗꍇ͑IȂɂȂ܂B

* `message`  
  \郁bZ[Ww肵܂Bȗꍇ͉\܂B

* ߂l  
  IꂽtH_̃pXԂ܂B
  LZꂽꍇ `None` Ԃ܂B

#### Application.choose_color(color: Color, alpha: bool = False) -> Color

FI_CAO\܂B

* `color`  
  ftHg̐F `Color` IuWFNgw肵܂B

* `alpha`  
  At@lݒ肳ꍇ `True` w肵܂B

* ߂l  
  IꂽF\ `Color` IuWFNgԂ܂B
  LZꂽꍇ `None` Ԃ܂B

*   
  ~~~
  app = PictureFan.Application()
  col = PictureFan.Color()
  col.set_rgb(0, 128, 255)
  col = app.choose_color(col)
  if col is not None:
      app.alert("RGB = " + col.red + "," + col.green + "," + col.blue)
  ~~~

#### Application.get_folder(type: str) -> str

̃tH_̃pX擾܂B

* `type`  
  擾tH_\w肵܂Bȉ̂ꂩłB
  啶Ə͋ʂ܂B

  * "app"  
    vÔtH_
  * "plugins"  
    vOCtH_
  * "appdata"  
    AvP[Vf[^
  * "appdata-local"  
    [JAvP[Vf[^
  * "common-appdata"  
    S[U[ʂ̃AvP[Vf[^
  * "common-desktop"  
    S[U[ʂ̃fXNgbvtH_
  * "common-documents"  
    S[U[ʂ My Documents
  * "common-favorites"  
    S[U[ʂ̂Cɓ
  * "common-music"  
    S[U[ʂ My Music
  * "common-pictures"  
    S[U[ʂ My Pictures
  * "common-startmenu"  
    S[U[ʂ̃X^[gj[
  * "common-startmenu-programs"  
    S[U[ʂ̃X^[gj[̃vO
  * "common-startup"  
    S[U[ʂ̃X^[gAbv
  * "common-templates"  
    S[U[ʂ̃ev[g
  * "common-video"  
    S[U[ʂ My Video
  * "documents"  
    My Documents
  * "desktop"  
    fXNgbvtH_
  * "favorites"  
    Cɓ
  * "fonts"  
    tHg
  * "music"  
    My Music
  * "pictures"  
    My Pictures
  * "programs"  
    Program Files
  * "startmenu"  
    X^[gj[
  * "startmenu-programs"  
    X^[gj[̃vO
  * "system"  
    VXe
  * "video"  
    My Video
  * "windows"  
    Windows

* ߂l  
  tH_̃pXԂ܂B
  擾łȂꍇ͋󕶎񂪕Ԃ܂B

#### Application.get_current_document() -> Document

݂̃hLg擾܂B

* ߂l  
  ݂̃hLg `Document` IuWFNgԂ܂B
  ꍇ None Ԃ܂B

#### Application.set_current_image(image: Image, text: str) -> bool

݂̉摜ݒ肵܂B
݂̉摜Ƃ́A

* CEBhEsĂꍇ́AANeBuȃEBhẺ摜
* ꊇϊsĂꍇ́AΏۂ̉摜

\܂B

* `image`  
  ݒ肷摜 `Image` IuWFNgw肵܂B

* `text`  
  ݒ肷摜̐̕w肵܂B

* ߂l  
  ݂̉摜ݒ肳ꂽꍇ `True` AݒłȂꍇ `False` Ԃ܂B

#### Application.get_current_image() -> Image

݂̉摜擾܂B

* ߂l  
  ݂̉摜 `Image` IuWFNgԂ܂B
  摜ꍇ `None` Ԃ܂B

#### Application.get_main_window() -> MainWindow

CEBhE擾܂B

* ߂l  
  CEBhE `MainWindow` IuWFNgԂ܂B

#### Application.thumbnails_window_count : int (read only)

JĂTlCEBhE̐łB

#### Application.get_thumbnails_window(index: int) -> ThumbnailsWindow

TlCEBhE擾܂B

* `index`  
  擾EBhE̔ԍw肵܂B
  0  `thumbnails_window_count` - 1 ̊ԂŎw肵܂B

* ߂l  
  TlCEBhE `ThumbnailsWindow` IuWFNgԂ܂B

#### Application.get_active_thumbnails_window() -> ThumbnailsWindow

݃ANeBuȃTlCEBhE擾܂B

* ߂l  
  TlCEBhE `ThumbnailsWindow` IuWFNgԂ܂B

#### Application.open_thumbnails_window() -> ThumbnailsWindow

VTlCEBhEJ܂B

* ߂l  
  TlCEBhE `ThumbnailsWindow` IuWFNgԂ܂B

#### Application.viewer_count : int (read only)

JĂPƃr[A̐łB

#### Application.get_viewer(index: int) -> Viewer

Pƃr[A擾܂B

* `index`  
  擾Pƃr[A̔ԍw肵܂B
  0  `viewer_count` - 1 ̊ԂŎw肵܂B

* ߂l  
  Pƃr[A `Viewer` IuWFNgԂ܂B

#### Application.get_active_viewer() -> Viewer

݃ANeBuȒPƃr[A擾܂B

* ߂l  
  Pƃr[A `Viewer` IuWFNgԂ܂B

#### Application.open_viewer(filename: str = "") -> Viewer

VPƃr[AJ܂B

* `filename`  
  Jt@C̃pXw肵܂Bȗƃt@CJĂȂԂɂȂ܂B

* ߂l  
  Pƃr[A `Viewer` IuWFNgԂ܂B

#### Application.set_progress(pos: int, max: int)

i󋵂ݒ肵܂B  
vOXo[ȂǂŐi󋵂悤ɂȂ܂B

* `pos`  
  iʒuw肵܂B0  `max` ܂ł͈̔͂łB

* `max`  
  iőʒuw肵܂B

*   
  ~~~
  app = PictureFan.Application();
  for i in range(100):
      app.set_progress(i, 99);
  ~~~

#### Application.store_data(key: str, data: str, persistent: bool = True)

f[^ۑ܂B
̃XNvgs܂ŁA炩̃f[^ۑĂꍇɗpł܂B

* `key`  
  ۑL[w肵܂B

* `data`  
  ۑf[^w肵܂B

* `persistent`  
  `True` ɂꍇAf[^̓vZX̎Nȍ~ێ܂B
  `False` ɂꍇAf[^̓vZXI_Ŕj܂B

#### Application.load_data(key: str) -> str

ۑf[^擾܂B

* `key`  
  擾L[w肵܂B

* ߂l  
  擾f[^̕񂪕Ԃ܂B
  f[^݂Ȃꍇ `None` Ԃ܂B

#### Application.delete_data(key: str) -> str

ۑf[^폜܂B

* `key`  
  폜L[w肵܂B

#### Application.is_data_exists(key: str) -> bool

f[^ۑĂ邩ۂ擾܂B

* `key`  
  擾L[w肵܂B

* ߂l  
  f[^ۑĂꍇ `True` AۑĂȂꍇ `False` Ԃ܂B


### WindowBase NX

EBhE̊NXłB

#### WindowBase.close(confirm: bool = True)

EBhE܂B

* `confirm`  
  ۑ̊mFsȂꍇ `False` w肵܂B  
  `True` w肵ꍇAݒŕۑ̊mFs悤ɂĂꍇ͊mFs܂B

#### WindowBase.restore()

EBhEő剻yэŏĂꍇȂ傫ɖ߂܂B

#### WindowBase.minimized : bool

EBhE̍ŏԂłB
ŏĂꍇ `True`AȊȌꍇ `False` łB

#### WindowBase.maximized : bool

EBhE̍ő剻ԂłB
ő剻Ăꍇ `True`AȊȌꍇ `False` łB

#### WindowBase.width : int

EBhE̕sNZPʂŕ\܂B

#### WindowBase.height : int

EBhE̍sNZPʂŕ\܂B

#### WindowBase.left : int

EBhE̍ʒuA_ƂXN[W̃sNZPʂŕ\܂B

#### WindowBase.top : int

EBhȄʒuA_ƂXN[W̃sNZPʂŕ\܂B

#### WindowBase.window_handle : int (read only)

EBhẼnhłB

#### WindowBase.title : str (read only)

EBhẼ^CgłB

#### WindowBase.set_position(left: int, top: int, width: int, height: int)

EBhËʒuݒ肵܂B

* `left`  
  EBhE̍ʒusNZPʂŕ\܂B

* `top`  
  EBhȄʒusNZPʂŕ\܂B

* `width`  
  EBhE̕sNZPʂŕ\܂B

* `height`  
  EBhE̍sNZPʂŕ\܂B

#### WindowBase.activate()

EBhEANeBuɂ܂B


### MainWindow NX

PictureFan ̃CEBhEłB  
`WindowBase` NXhĂ܂B  
`Application.get_main_window()` Ŏ擾܂B

#### MainWindow.open_document(filename: str) -> Document

hLgJ܂B

* `filename`  
  JhLg̃pXw肵܂B

* ߂l  
  JhLg `Document` IuWFNgԂ܂B
  hLgJȂꍇ `None` Ԃ܂B

#### MainWindow.open_image(image: Image, name: str) -> Document

w肳ꂽ摜hLgƂĊJ܂B

* `image`  
  J摜 `Image` IuWFNgw肵܂B

* `name`  
  O̕w肵܂B

* ߂l  
  JhLg `Document` IuWFNgԂ܂B
  hLgJȂꍇ `None` Ԃ܂B

#### MainWindow.active_document : Document

݃ANeBuȃhLg `Document` IuWFNgłB

#### MainWindow.document_count : int (read only)

JĂhLg̐łB

#### MainWindow.get_document(index: int) -> Document

hLg擾܂B

* `index`  
  擾hLg̃CfbNXw肵܂B
  0 ŏ̃hLgŁA`document_count` - 1 ŌłB

* ߂l  
  擾hLg `Document` IuWFNgԂ܂B

#### MainWindow.do_action(action: str)

PictureFan ̋@\s܂B

* `action`  
  s@\w肵܂B
  wł镶́ACEBhẼj[ [wv] -> [R}hꗗ] ŊmFł܂B


### Image NX

摜\NXłB

#### Image.create(width: int, height: int, colorspace: Colorspace, bits_per_plane: int, planes_per_pixel: int)

摜쐬܂B  
쐬ꂽ摜͑SẴsNZ̒l 0 ŏ܂B

* `width`  
  摜̕sNZPʂŎw肵܂B

* `height`  
  摜̍sNZPʂŎw肵܂B

* `colorspace`  
  摜̐FԂw肵܂Bȉ̂ꂩłB

  * `Colorspace.RGB`  
    RGB
  * `Colorspace.GRAYSCALE`  
    OCXP[()
  * `Colorspace.INDEXED`  
    CfbNXJ[

  () ݂̂ƂAOCXP[摜̓tB^ȂǂőΉĂȂ̂܂B

* `bits_per_plane`  
  摜̃v[̃rbgw肵܂B
  RGB 摜̏ꍇ816AOCXP[摜̏ꍇ1/8/16̂ꂩACfbNXJ[摜̏ꍇ1/4/8̂ꂩłB

* `planes_per_pixel`  
  摜̃sNZ̃v[w肵܂B
  RGB 摜̏ꍇ34AOCXP[摜̏ꍇ12ACfbNXJ[摜̏ꍇ1łB

#### Image.copy() -> Image

摜̕쐬܂B

* ߂l  
  摜Ԃ܂B

#### Image.discard()

摜j܂B

#### Image.load_from_file(filename: str, format: str = "")

t@C摜ǂݍ݂܂B

* `filename`  
  t@C̃pXw肵܂B

* `format`  
  ǂݍރtH[}bgw肵܂B"bmp" / "jpeg" / "png" łB
  tH[}bgIɔʂꍇ͋󕶎w肵܂B

#### Image.load_from_memory(data: bytes, filename: str = "", format: str = "")

摜ǂݍ݂܂B

* `data`  
  ǂݍރf[^w肵܂B

* `filename`  
  t@Cw肵܂BtH[}bg̔ʂȂǂɎg܂B
  ꍇ͋󕶎w肵܂B

* `format`  
  ǂݍރtH[}bgw肵܂B"bmp" / "jpeg" / "png" łB
  tH[}bgIɔʂꍇ͋󕶎w肵܂B

#### Image.save_to_file(filename: str, format: str, options: dict = {})

t@Cɉ摜ۑ܂B

* `filename`  
  ۑt@Cw肵܂B

* `format`  
  ۑtH[}bgw肵܂B"bmp" / "jpeg" / "png" łB

* `options`  
  ۑIvVw肵܂BL[ƒl̎n܂B  
  Ⴆ JPEG ̕iw肷ɂ́A`{"Quality": 90}` ̂悤ɂ܂B  
  ̓R}hCɂꊇϊ /format-prop ł̎wƓłB

#### Image.save_to_memory(format: str, options: dict = None) -> bytes

ɉ摜ۑ܂B

* `format`  
  ۑtH[}bgw肵܂B"bmp" / "jpeg" / "png" łB

* `options`  
  ۑIvVw肵܂B
  `save_to_file` ̉QƂĂB

* ߂l  
  ۑf[^Ԃ܂B

#### Image.load_from_clipboard()

Nbv{[h摜ǂݍ݂܂B

#### Image.copy_to_clipboard()

Nbv{[hɉ摜Rs[܂B

#### Image.width : int (read only)

摜̕sNZPʂŕ\܂B

#### Image.height : int (read only)

摜̍sNZPʂŕ\܂B

#### Image.colorspace: Colorspace (read only)

摜̐FԂ\܂B

#### Image.bits_per_pixel : int (read only)

摜1sNZ̃rbg\܂B

#### Image.bits_per_plane : int (read only)

摜̃v[̃rbg\܂B

#### Image.planes_per_pixel : int (read only)

摜̃sNZ̃v[\܂B

#### Image.x_resolution : int

̉𑜓x\܂BɎw肪ꍇ 0 łB

#### Image.y_Resolution : int

̉𑜓x\܂BɎw肪ꍇ 0 łB

#### Image.resolution_unit : ResolutionUnit

𑜓x̒Pʂ\܂B
ȉ̂ꂩłB

  * `ResolutionUnit.UNDEFINED`  
    wȂ
  * `ResolutionUnit.INCH`  
    1 C`̃sNZ
  * `ResolutionUnit.CENTIMETRE`  
    1 Z`[g̃sNZ
  * `ResolutionUnit.METRE`  
    1 [g̃sNZ

#### Image.set_palette(palette: Palette)

摜̃pbgݒ肵܂B
摜̐FԂCfbNXJ[łKv܂B

* `palette`  
  ݒ肷pbg `Palette` IuWFNgw肵܂B  
  pbgɊ܂܂F̐摜̐F菭ȂꍇAc̐F͑S0ɂȂ܂B

#### Image.get_palette() -> Palette

摜̃pbg擾܂B

* ߂l  
  擾pbg\ `Palette` IuWFNgԂ܂B  
  摜̐FԂCfbNXJ[łȂꍇ `None` Ԃ܂B

#### Image.format : str (read only)

摜t@Cǂݍ܂ꂽꍇ̃t@C`\܂B  
"bmp" / "jpeg" / "png" ̕łB
摜t@Cǂݍ܂ĂȂtH[}bgs̏ꍇ͋łB

#### Image.empty : bool (read only)

摜ł邩ǂ\܂B  
摜܂쐬ĂȂAɔjĂꍇ `True` ɂȂ܂B

#### Image.set_pixel(x: int, y: int, color: Color)

摜̃sNZ̐Fݒ肵܂B  
x߁A摜Ŝ`悷悤ȂƂsƎԂ|܂B

* `x`  
  ʒusNZPʂŎw肵܂B

* `y`  
  ʒusNZPʂŎw肵܂B

* `color`  
  ݒ肷F `Color` IuWFNgw肵܂B

#### Image.get_pixel(x: int, y: int) -> Color

摜̃sNZ̐F擾܂B

* `x`  
  ʒusNZPʂŎw肵܂B

* `y`  
  ʒusNZPʂŎw肵܂B

* ߂l  
  擾F `Color` IuWFNgԂ܂B

#### Image.selected : bool

͈͑IĂ邩ǂ\܂B  
͈͂IĂȂ摜ɑ΂ `selected`  `True` ɂƁAŜI܂B

#### Image.set_selected_rect(rect: Rectangle)

I͈͂ݒ肵܂B

* `rect`  
  I͈͂̋`w肵܂B

#### Image.get_selected_rect() -> Rectangle

I͈͂擾܂B

* ߂l  
  I͈͂̋`\ `Rectangle` IuWFNgԂ܂B  
  ͈͂IĂȂꍇ́A摜Ŝ\`Ԃ܂B

#### Image.set_text(type: str, text: str)

摜̃eLXgݒ肵܂B

* `type`  
  ݒ肷eLXg̎ނw肵܂Bȉ̂ꂩłB

  * "author"  
    
  * "comment"  
    Rg
  * "name"  
    O

* `text`  
  ݒ肷eLXgw肵܂B

#### Image.get_text(type: str) -> str

摜̃eLXg擾܂B

* `type`  
  擾eLXg̎ނw肵܂B
  擾łނ `set_text` QƂĂ B

* ߂l  
  擾eLXg񂪕Ԃ܂B  
  w肳ꂽނ̃eLXg݂Ȃꍇ͋󕶎񂪕Ԃ܂B

#### Image.set_metadata(type: str, data: bytes)

摜Ƀ^f[^ݒ肵܂B

* `type`  
  ݒ肷郁^f[^̎ނw肵܂Bȉ̂ꂩłB

  * "exif"  
    Exif
  * "icc_profile"  
    ICC vt@C
  * "xmp"  
    XMP  
    ݒ肷f[^ Packet Wrapper ܂܂ȂꍇAPacket Wrapper t܂B

* 'data'  
  ݒ肷f[^w肵܂B

#### Image.get_metadata(type: str) -> bytes

摜̃^f[^擾܂B

* `type`  
  擾郁^f[^̎ނw肵܂B
  擾łނ `set_metadata` QƂĂ B

* ߂l  
  擾f[^Ԃ܂B  
  w肳ꂽނ̃f[^݂Ȃꍇ `None` Ԃ܂B

#### Image.page_count : int (read only)

摜̃y[WłB

#### Image.current_page_index : int

݂̃y[W̃CfbNXłB0  `page_count` - 1 ܂łłB

#### Image.add_page(image: Image)

y[Wǉ܂B

* `image`
  ǉ摜łB

#### Image.insert_page(index: int, image: Image)

y[W}܂B

* `index`
  }ʒuw肵܂B0  `page_count` ܂łłB

* `image`
  }摜łB

#### Image.delete_page(index: int)

y[W폜܂B

* `index`
  폜y[W̃CfbNXw肵܂B
  0  `page_count` - 1 ܂łłB

#### Image.remove_page(index: int) -> Image

y[W폜āẢ摜擾܂B

* `index`
  폜y[W̃CfbNXw肵܂B
  0  `page_count` - 1 ܂łłB

* ߂l
  폜y[W̉摜łB

#### Image.copy_pixels(dst_left: int, dst_top: int, src_image: Image, src_left: int, src_top: int, width: int, height: int)

摜̃f[^Rs[܂B

* `dst_left`  
  Rs[̍ʒusNZPʂŎw肵܂B

* `dst_top`  
  Rs[̏ʒusNZPʂŎw肵܂B

* `src_image`  
  Rs[̉摜w肵܂B

* `src_left`  
  Rs[̍ʒusNZPʂŎw肵܂B

* `src_top`  
  Rs[̏ʒusNZPʂŎw肵܂B

* `width`  
  Rs[镝sNZPʂŎw肵܂B

* `height`  
  Rs[鍂sNZPʂŎw肵܂B

#### Image.composite_pixels(dst_left: int, dst_top: int, src_image: Image, src_left: int, src_top: int, width: int, height: int, opacity: float = 1.0)

摜̃f[^܂B

* `dst_left`  
  ̍ʒusNZPʂŎw肵܂B

* `dst_top`  
  ̏ʒusNZPʂŎw肵܂B

* `src_image`  
  ̉摜w肵܂B

* `src_left`  
  ̍ʒusNZPʂŎw肵܂B

* `src_top`  
  ̏ʒusNZPʂŎw肵܂B

* `width`  
  镝sNZPʂŎw肵܂B

* `height`  
  鍂sNZPʂŎw肵܂B

* `opacity`  
  sx 0.0  1.0 ͈̔͂Ŏw肵܂B

#### Image.to_bytes() -> bytes

摜 `bytes` IuWFNgɕϊ܂B

* ߂l  
  ϊꂽ `bytes` IuWFNgԂ܂B

#### Image.from_bytes(width: int, height: int, colorspace: Colorspace, bits_per_plane: int, planes_per_pixel: int, data: bytes)

bytes ̃f[^摜쐬܂B  

* `width`  
  摜̕sNZPʂŎw肵܂B

* `height`  
  摜̍sNZPʂŎw肵܂B

* `colorspace`  
  摜̐FԂw肵܂Bȉ̂ꂩłB

  * `Colorspace.RGB`  
    RGB
  * `Colorspace.GRAYSCALE`  
    OCXP[()
  * `Colorspace.INDEXED`  
    CfbNXJ[

  () ݂̂ƂAOCXP[摜̓tB^ȂǂőΉĂȂ̂܂B

* `bits_per_plane`  
  摜̃v[̃rbgw肵܂B
  RGB 摜̏ꍇ816AOCXP[摜̏ꍇ1/8/16̂ꂩACfbNXJ[摜̏ꍇ1/4/8̂ꂩłB

* `planes_per_pixel`  
  摜̃sNZ̃v[w肵܂B
  RGB 摜̏ꍇ34AOCXP[摜̏ꍇ12ACfbNXJ[摜̏ꍇ1łB

* `data`  
  ϊ̃f[^w肵܂B

#### Image.set_pixel_bytes(data: bytes)

bytes ̃f[^摜̃sNZf[^ƂăRs[܂B  

* `data`  
  Rs[̃f[^w肵܂B

#### Image.to_matrix() -> Matrix

摜 `Matrix` IuWFNgɕϊ܂B

* ߂l  
  ϊꂽ `Matrix` IuWFNgԂ܂B

#### Image.to_matrix_rgb() -> Matrix

摜 RGB ` `Matrix` IuWFNgɕϊ܂B

* ߂l  
  ϊꂽ `Matrix` IuWFNgԂ܂B

#### Image.from_matrix(matrix: Matrix)

`Matrix` IuWFNg摜쐬܂B

#### Image.extract_plane(plane: int) -> Matrix

摜̃v[ `Matrix` IuWFNgɕϊ܂B

* `plane`  
  ϊv[w肵܂B

* ߂l  
  ϊꂽ `Matrix` IuWFNgԂ܂B

#### Image.extract_plane_rgb(plane: int) -> Matrix

摜 RGB v[ `Matrix` IuWFNgɕϊ܂B

* `plane`  
  ϊv[w肵܂B

* ߂l
  ϊꂽ `Matrix` IuWFNgԂ܂B

#### Image.to_1bit(monochrome: bool, dither: str = "") -> Image

摜1rbgɕϊ܂B

* `monochrome`  
  摜𔒍ɕϊꍇ `True` w肵܂B  
  `False` w肷ƁAœKpbggpCfbNXJ[摜ɂȂ܂B

* `dither`  
  fBU̎ނw肵܂Bȉ̂ꂩwł܂B
  ȗƒPߎɂȂ܂B

  * "approx"  
    Pߎ
  * "bayer"  
    Bayer
  * "diffuse"  
    덷gU
  * "random"  
    _fBU

  ܂Aނ̌ : ɑăfBŰwł܂B
  Ⴆ "diffuse:50" ̂悤Ɏw肵܂B
  1100܂łŁAl傫قǋfBU|܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.to_indexed4(colors: int = 16, dither: str = "") -> Image

摜4rbgCfbNXJ[ɕϊ܂B

* `colors`  
  ϊ̍ő̐Fw肵܂B
  1  16 ܂ł͈̔͂łB

* `dither`  
  fBU̎ނw肵܂Bȉ̂ꂩwł܂B
  ȗƒPߎɂȂ܂B

  * "approx"  
    Pߎ
  * "diffuse"  
    덷gU

  ܂Aނ̌ : ɑăfBŰwł܂B
  Ⴆ "diffuse:50" ̂悤Ɏw肵܂B
  1100܂łŁAl傫قǋfBU|܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.to_indexed8(colors: int = 256, dither: str = "") -> Image

摜8rbgCfbNXJ[ɕϊ܂B

* `colors`  
  ϊ̍ő̐Fw肵܂B
  1  256 ܂ł͈̔͂łB

* `dither`  
  fBU̎ނw肵܂Bȉ̂ꂩwł܂B
  ȗƒPߎɂȂ܂B

  * "approx"  
    Pߎ
  * "diffuse"  
    덷gU

  ܂Aނ̌ : ɑăfBŰwł܂B
  Ⴆ "diffuse:50" ̂悤Ɏw肵܂B
  1100܂łŁAl傫قǋfBU|܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.to_rgb8() -> Image

摜8rbgRGBɕϊ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.to_rgba8() -> Image

摜8rbgRGBAɕϊ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.to_rgb16() -> Image

摜16rbgRGBɕϊ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.to_rgba16() -> Image

摜16rbgRGBAɕϊ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.resize(width: int, height: int, resample: Resample = Resample.NEAREST_NEIGHBOR) -> Image

摜̑傫ύX܂B

* `width`  
  摜̕sNZPʂŎw肵܂B

* `height`  
  摜̍sNZPʂŎw肵܂B

* `resample`  
  ăTvO̕@w肵܂Bȉ̂ꂩłB

  * `Resample.NEAREST_NEIGHBOR`  
    ŋߖT
  * `Resample.BILINEAR`  
    `
  * `Resample.AVERAGING`  
    ωf@
  * `Resample.TRIANGLE`  
    Triangle
  * `Resample.HERMITE`  
    Hermite
  * `Resample.HANNING`  
    Hanning
  * `Resample.HAMMING`  
    Hamming
  * `Resample.BLACKMAN`  
    Blackman
  * `Resample.GAUSSIAN`  
    Gaussian
  * `Resample.QUADRATIC`  
    Quadratic
  * `Resample.CUBIC`  
    Cubic
  * `Resample.CATROM`  
    Catrom
  * `Resample.MITCHELL`  
    Mithcell
  * `Resample.SINC`  
    Sinc
  * `Resample.LANCZOS2`  
    Lanczos2
  * `Resample.LANCZOS3`  
    Lanczos3
  * `Resample.LANCZOS4`  
    Lanczos4
  * `Resample.LANCZOS8`  
    Lanczos8
  * `Resample.BICUBIC`  
    Bicubic

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.crop(left: int, top: int, width: int, height: int) -> Image

摜؂蔲܂B

* `left`  
  ؂蔲ʒusNZPʂŎw肵܂B

* `top`  
  ؂蔲ʒusNZPʂŎw肵܂B

* `width`  
  ؂蔲sNZPʂŎw肵܂B

* `height`  
  ؂蔲sNZPʂŎw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.rotate(angle: float, resample: str = "", back_color: Color = None) -> Image

摜]܂B

* `angle`  
  ]pxAvɓx(degree)PʂŎw肵܂B

* `resample`  
  ăTvO̕@w肵܂Bȉ̂ꂩłB
  ȗƍŋߖTԂɂȂ܂B

  * "nearestneighbor"  
    ŋߖT
  * "bilinear"  
    `

* `back_color`  
  wiFw肵܂B
  ȗƉ摜ɃAt@v[ꍇ͓ɁAȂꍇ͍ɂȂ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### Image.flip_vertical()

摜㉺ɔ]܂B

#### Image.flip_horizontal()

摜Eɔ]܂B


### ImageFilter NX

摜ɃtB^sNXłB

#### ImageFilter.grayscale(image: Image) -> Image

摜OCXP[ɕϊ܂B

* `image`  
  ϊ̉摜łB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.monochrome(image: Image, threshold: int) -> Image

摜𔒍Kɕϊ܂B

* `image`  
  ϊ̉摜łB

* `threshold`  
  臒lw肵܂B
  ̒lȏ̋Px̐FƂȂA̒l̋Px̐FƂȂ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.sepia(image: Image) -> Image

摜ZsAFɕϊ܂B

* `image`  
  ϊ̉摜łB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.negative(image: Image) -> Image

摜lK|W]܂B

* `image`  
  ϊ̉摜łB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.enhance_colors(image: Image, hue: float = 0.0, brightness: float = 0.0, saturation: float = 0.0, contrast: float = 0.0) -> Image

F␳s܂B

* `image`  
  ϊ̉摜łB

* `hue`  
  FVtg銄w肵܂B1.0  360 xɓ܂B

* `brightness`  
  Px𒲐銄w肵܂B-1.0  1.0 ̊ԂŎw肵܂B

* `saturation`  
  ʓx𒲐銄w肵܂B-1.0  1.0 ̊ԂŎw肵܂B

* `contrast`  
  RgXg𒲐銄w肵܂B-1.0  1.0 ̊ԂŎw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.rgb_balance(image: Image, red: int, green: int, blue: int) -> Image

RGB lZ܂B

* `image`  
  ϊ̉摜łB

* `red`  
  ԂɉZlw肵܂B

* `green`  
  ΂ɉZlw肵܂B

* `blue`  
  ɉZlw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.gamma_correction(image: Image, red: float, green: float, blue: float) -> Image

K}␳s܂B

* `image`  
  ϊ̉摜łB

* `red`  
  Ԃ̃K}lw肵܂B

* `green`  
  ΂̃K}lw肵܂B

* `blue`  
  ̃K}lw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.colorize(image: Image, color: Color, black_base: bool) -> Image

PFJ[XP[ɕϊ܂B

* `image`  
  ϊ̉摜łB

* `color`  
  ϊF Color IuWFNgw肵܂B

* `black_base`  
  x[X̐Fɂꍇ `True` Aɂꍇ `False` w肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.solarization(image: Image, threshold: int) -> Image

\[[Vs܂B

* `image`  
  ϊ̉摜łB

* `threshold`  
  臒lw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.swap_rgb(image: Image, type: str) -> Image

RGB ̊ev[ւ܂B

* `image`  
  ϊ̉摜łB

* `type`  
  RGB lւp^[w肵܂B
  R/G/B ̎Ogݍ킹ŁAe RGB lւԂ\܂B
  Ⴆ "GRB" Ǝw肷ƁAG  R ւAB ͂̂܂܂ɂȂ܂B
  ̂ƂAv[𕡐gp邱Ƃ͂ł܂(Ⴆ "RRB" Ȃ)B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.equalize() -> Image

CRCYs܂B

* `image`  
  ϊ̉摜łB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.normalize() -> Image

m[}CYs܂B

* `image`  
  ϊ̉摜łB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.smoothing(image: Image, radius: int, ratio: float = 0.5) -> Image

s܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  ܂傫Ȓlw肷ƏɔɎԂ|܂̂ŒӂĂB

* `ratio`  
  Kp銄w肵܂B
  0  1 ̊ԂŎw肵Al傫قǋKp܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.sharpening(image: Image, radius: int, ratio: float = 0.5) -> Image

ss܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  ܂傫Ȓlw肷ƏɔɎԂ|܂̂ŒӂĂB

* `ratio`  
  Kp銄w肵܂B
  0  1 ̊ԂŎw肵Al傫قǋKp܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.convolve(image: Image, matrix: list) -> Image

ݍݏs܂B

* `image`  
  ϊ̉摜łB

* `matrix`  
  s\ `list` łB

* ߂l  
  ϊꂽ摜Ԃ܂B

* 
  ~~~
  matrix = [[-0.5, 0.0, 0.5], [-1.0, 1.0, 1.0], [0.5, 0.0, -0.5]]
  new_image = PictureFan.ImageFilter().convolve(src_image, matrix)
  ~~~

#### ImageFilter.blur(image: Image, radius: int) -> Image

ڂs܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  傫Ȓlw肷ƔɎԂ|܂̂ŒӂĂB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.gaussian_blur(image: Image, radius: int, sigma: float = 0.5) -> Image

KEXڂs܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  ڂ͈͂̔aw肵܂B

* `sigma`  
  W΍łB
  0  1 ܂ł̒lw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.motion_blur(image: Image, radius: int, angle: float, sigma: float = 0.5) -> Image

[Vu[s܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  ڂaw肵܂B

* `angle`  
  ڂpxvɓx(degree)PʂŎw肵܂B

* `sigma`  
  W΍łB
  0  1 ܂ł̒lw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.emboss(image: Image, radius: int, color: bool = False) -> Image

G{Xs܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B

* `color`  
  e RGB v[ɏsꍇ `True` Av[܂Ƃ߂ďsꍇ `False` w肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.sobel(image: Image) -> Image

֊sos܂B

* `image`  
  ϊ̉摜łB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.pixelize(image: Image, width: int, height: int) -> Image

UCNs܂B

* `image`  
  ϊ̉摜łB

* `width`  
  w肵܂B

* `height`  
  w肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.posterize(image: Image, steps: int) -> Image

|X^CYs܂B

* `image`  
  ϊ̉摜łB

* `steps`  
  Kw肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.median(image: Image, radius: int) -> Image

ԒltB^s܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  傫Ȓlw肷ƏɔɎԂ|܂̂ŒӂĂB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.minimum(image: Image, radius: int) -> Image

ŏltB^s܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  傫Ȓlw肷ƏɔɎԂ|܂̂ŒӂĂB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.maximum(image: Image, radius: int) -> Image

őltB^s܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  傫Ȓlw肷ƏɔɎԂ|܂̂ŒӂĂB

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.noise(image: Image, type: str, density: float, amount: float) -> Image

mCYs܂B

* `image`  
  ϊ̉摜łB

* `type`  
  mCY̎ނw肵܂Bȉ̂ꂩłB

  * "color"  
    F̃mCY
  * "brightness"  
    x̃mCY
  * "hue"  
    F̃mCY
  * "saturation"  
    ʓx̃mCY

* `density`  
  mCY̖xw肵܂B
  0  1 ܂ł̊ԂŁA1 łxȂ܂B

* `amount`  
  mCY̋w肵܂B
  0  1 ܂ł̊ԂŁA1 łȂ܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.spread(image: Image, amount: int) -> Image

gUs܂B

* `image`  
  ϊ̉摜łB

* `amount`  
  gU͈͂w肵܂B

* ߂l  
  ϊꂽ摜Ԃ܂B

#### ImageFilter.oil_paint(image: Image, radius: int) -> Image

Gɕϊ܂B

* `image`  
  ϊ̉摜łB

* `radius`  
  saw肵܂B
  傫Ȓlw肷ƏɔɎԂ|܂̂ŒӂĂB

* ߂l  
  ϊꂽ摜Ԃ܂B


### Color NX

F\NXłB

#### Color.set_rgb(red: int, green: int, blue: int, alpha: int = 255)

RGBl8rbgŐݒ肵܂B

* `red`  
  Ԃ̒lw肵܂B

* `green`  
  ΂̒lw肵܂B

* `blue`  
  ̒lw肵܂B

* `alpha`  
  sx̒lw肵܂B0 ŊSȓA255 ŊSȕsłB

#### Color.set_rgb16(red: int, green: int, blue: int, alpha: int = 65535)

RGBl16rbgŐݒ肵܂B

* `red`  
  Ԃ̒lw肵܂B

* `green`  
  ΂̒lw肵܂B

* `blue`  
  ̒lw肵܂B

* `alpha`  
  sx̒lw肵܂B0 ŊSȓA65535 ŊSȕsłB

#### Color.red : int

8rbgŕ\Ԃ̒lłB

#### Color.red16 : input

16rbgŕ\Ԃ̒lłB

#### Color.green : int

8rbgŕ\΂̒lłB

#### Color.green16 : int

16rbgŕ\΂̒lłB

#### Color.blue : int

8rbgŕ\̒lłB

#### Color.blue16 : int

16rbgŕ\̒lłB

#### Color.alpha : int

8rbgŕ\sx̒lłB

#### Color.alpha16 : int

16rbgŕ\sx̒lłB

#### Color.index : int

CfbNX̒lłB0  255 ܂ł͈̔͂łB


### Palette NX

pbg\NXłB

#### Palette.get_color(index: int) -> Color

pbgF擾܂B

* `index`  
  F擾CfbNXw肵܂B

* ߂l  
  擾FԂ܂B

#### Palette.set_color(index: int, color: Color)

  pbg̐Fݒ肵܂B

* `index`  
  Fݒ肷CfbNXw肵܂B

* `color`  
  ݒ肷F `Color` IuWFNgw肵܂B

#### Palette.count : int

pbg̐F̐łB


### Rectangle NX

`\NXłB

#### Rectangle.left : int

ʒu\܂B

#### Rectangle.top : int

ʒu\܂B

#### Rectangle.right : int

Eʒu\܂B  
͈͂ƂĂ͂̒l 1 lɂȂ܂B  
Ⴆ΁A`left`  0  `right`  100 ̏ꍇA 100 ɂȂA
͈͂ƂĂ 0  99 ܂ł\ƂɂȂ܂B
̂悤ɂȂĂ̂́AȂƕ 0 \łȂ߂łB

#### Rectangle.bottom : int

ʒu\܂B  
͈͂ƂĂ͂̒l 1 lɂȂ܂B  
Ⴆ΁A`top`  0  `bottom`  100 ̏ꍇA 100 ɂȂA
͈͂ƂĂ 0  99 ܂ł\ƂɂȂ܂B
̂悤ɂȂĂ̂́AȂƍ 0 \łȂ߂łB

#### Rectangle.width : int

\܂B

#### Rectangle.height : int

\܂B

#### Rectangle.set(left: int, top: int, width: int, height: int)

`ݒ肵܂B

* `left`  
  ʒuw肵܂B

* `top`  
  ʒuw肵܂B

* `width`  
  w肵܂B

* `height`  
  w肵܂B

#### Rectangle.move(horz: int, vert: int)

`ړ܂B

* `horz`  
  ̈ړʂw肵܂B

* `vert`  
  ̈ړʂw肵܂B


### Matrix NX

s\NXłB
摜f[^sƂĈ̂ɗp܂B

#### Matrix.create(rows: int, columns: int, planes: int, type: str)

s쐬܂BʏAڍ쐬邱Ƃ͂܂B

* `rows`  
  sw肵܂B

* `columns`  
  񐔂w肵܂B

* `planes`  
  v[w肵܂B

* `type`  
  vf̌^w肵܂Bȉ̂ꂩłB

  * "uint8"  
    8rbg
  * "uint16"  
    16rbg

#### Matrix.discard()

s̃f[^j܂B

#### Matrix.copy() -> Matrix

s𕡐܂B

* ߂l  
   Matrix IuWFNgԂ܂B

#### Matrix.to_bytes() -> bytes

f[^ bytes ɕϊ܂B

* ߂l  
  ϊ bytes Ԃ܂B

#### Matrix.from_bytes(data: bytes)

bytes f[^ݒ肵܂B

* `data`  
  ݒ肷f[^ bytes w肵܂B

#### Matrix.rows : int (read only)

s\܂B

#### Matrix.columns : int (read only)

񐔂\܂B

#### Matrix.planes : int (read only)

v[\܂B

#### Matrix.dimensions : int (read only)

\܂B

#### Matrix.item_size : int (read only)

eACẽoCg\܂B


### Document NX

hLg\NXłB
`WindowBase` NXhĂ܂B

#### Document.file_path : str (read only)

t@C̃pXłB

#### Document.media_type : str (read only)

hLg̃fBAłBȉ̂ꂩɂȂ܂B

  * "image"  
    摜
  * "video"  
    
  * "audio"  
    
  * "text"  
    eLXg
  * "binary"  
    oCi
  * "custom"  
    JX^

#### Document.is_archive : bool (read only)

ɓ̃t@Cł邩ǂ\܂B
ɓ̃t@C̏ꍇ True ɂȂ܂B

#### Document.modified : bool

hLgύXĂ邩ǂ\܂B
hLgύXĂꍇ True ɂȂ܂B

#### Document.get_image() -> Image

hLg̉摜擾܂B
擾ꂽ摜͎ۂ̉摜̃Rs[łB

#### Document.set_image(image: Image, descript: str = "")

hLg̉摜ݒ肵܂B
ݒ肳͎̂w肵摜̃Rs[łB

* `image`  
  ݒ肷摜w肵܂B

* `descript`  
  ݒ肷摜̐̕w肵܂B
  ȗ "XNvg" ɂȂ܂B

### Document.selected : bool

͈͑IĂ邩ǂ\܂B  
͈͂IĂȂ摜ɑ΂ `selected`  `True` ɂƁAŜI܂B

#### Document.set_selected_rect(rect: Rectangle)

hLg̉摜̑I͈͂ݒ肵܂B  
`Document.get_image` ŉ摜擾Ă `Image.set_selected_rect`A`Document.set_image` ƌĂőI͈͂XVIɐݒł܂B

* `rect`  
  I͈͂̋`w肵܂B

#### Document.get_selected_rect() -> Rectangle

hLg̉摜̑I͈͂擾܂B  
`Document.get_image` ŉ摜擾Ă `Image.get_selected_rect` ĂԂIɑI͈͂擾ł܂B

* ߂l  
  I͈͂̋`\ `Rectangle` IuWFNgԂ܂B  
  ͈͂IĂȂꍇ́A摜Ŝ\`Ԃ܂B

#### Document.do_action(action: str)

@\s܂B

* `action`  
  s@\w肵܂B
  wł镶́ACEBhẼj[ [wv] -> [R}hꗗ] ŊmFł܂B

#### Document.set_user_property(name: str, value: Any) -> bool

[U[vpeBݒ肵܂B

* `name`  
  vpeBw肵܂Bȉ̂ꂩłB

  * `author`  
    (str)
  * `label`  
    x(int) (1`30)
  * `note`  
    (str)
  * `rating`  
    ](int) (1`100)  
    ]̒l͐̐ƈȉ̂悤ɑΉĂ܂B  
    Iɐ0.5Pʂŕ]ł悤ɂ\܂Â݂Ƃ20E40E60E80E100̂ꂩ̒lgpĂB  
    (1`)20   
    (21`)40   
    (41`)60   
    (61`)80   
    (81`)100 
  * `tags`  
    ^O(str)
  * `title`  
    ^Cg(str)

* `value`  
  ݒ肷lw肵܂B`None` w肷ƃvpeB폜܂B

* ߂l  
  ɃvpeBݒ肳ꂽꍇ `True` AݒłȂꍇ͏ꍇ `False` Ԃ܂B

#### Document.get_user_property(name: str) -> Any

[U[vpeB擾܂B

* `name`  
  vpeBw肵܂Bwł閼O `set_user_property` ̉QƂĂB

* ߂l  
  vpeB̒lԂ܂BvpeB݂Ȃꍇ `None` Ԃ܂B

#### Document.set_user_properties(properties: Dict) -> bool

ׂẴ[U[vpeBݒ肵܂B

* `properties`  
  ݒ肷vpeBL[ƂĂ̒li[ dict w肵܂B  
  włvpeB `set_user_property` ̉QƂĂB  
  w肳ꂽ dict ɑ݂ȂvpeB͍폜܂B  
   dict w肷ƁAׂẴvpeB폜܂B

* ߂l  
  ɃvpeBݒ肳ꂽꍇ `True` AݒłȂꍇ͏ꍇ `False` Ԃ܂B

#### Document.get_user_properties() -> Dict

ׂẴ[U[vpeB擾܂B

* ߂l  
  vpeBL[ƂĂ̒li[ dict Ԃ܂B  
  płvpeB `set_user_property` ̉QƂĂB


### Viewer NX

Pƃr[A\NXłB
`Document` NXhĂ܂B
݂̂Ƃǉ̃\bh͂܂B


### PopupMenu NX

|bvAbvj[\NXłB
ʏɃj[\邱Ƃł܂B

Tv:

~~~
menu = PictureFan.PopupMenu()
menu.add("menu1", "Menu 1")
menu.add("menu3", "Menu 3")
menu.insert(1, "menu2", "Menu 2")
result = menu.show()
if result != "":
    app.alert(result)
~~~

#### PopupMenu.add(name: str, text: str = "", sub_menu: PopupMenu = None)

j[̖ɍڂǉ܂B

* `name`  
  ږw肵܂B
  ږƂ́Aej[ڂʂ邽߂̕łB

* `text`  
  ڂɕ\镶w肵܂B
  ̕w肷ƁA؂ɂȂ܂B

* `sub_menu`  
  Tuj[Ƃĕ\ `PopupMenu` IuWFNgw肵܂B
  Tuj[ڂłȂꍇ `None` w肵܂B

#### PopupMenu.insert(index: int, name: str, text: str = "", sub_menu: PopupMenu = None)

j[ڂ}܂B

* `index`  
  ڂ̑}ʒuw肵܂B
  ŏ̍ڂƂđ}ꍇ 0 w肵܂B

* `name`  
  ږw肵܂B
  ږƂ́Aej[ڂʂ邽߂̕łB

* `text`  
  ڂɕ\镶w肵܂B
  ̕w肷ƁA؂ɂȂ܂B

* `sub_menu`  
  Tuj[Ƃĕ\ PopupMenu IuWFNgw肵܂B
  Tuj[ڂłȂꍇ None w肵܂B

#### PopupMenu.remove(name: str)

j[ڂ폜܂B

* `name`  
  폜鍀ږw肵܂B

#### PopupMenu.get_item_pos(name: str) -> int

ڂ̈ʒu擾܂B

* `name`  
  ږw肵܂B

* ߂l  
  ڂ̈ʒuԂ܂Bԍŏ̍ڂ 0 ƂȂ܂B
  ڂ݂Ȃꍇ -1 Ԃ܂B

#### PopupMenu.set_item_checked(name: str, checked: bool)

ڂ̃`FbNԂݒ肵܂B

* `name`  
  ږw肵܂B

* `checked`  
  ڂ`FbNꍇ `True` A`FbNȂꍇ `False` w肵܂B

#### PopupMenu.get_item_checked(name: str) -> bool

ڂ̃`FbNԂ擾܂B

* `name`  
  ږw肵܂B

* ߂l  
  ڂ`FbNĂꍇ `True` A`FbNĂȂꍇ `False` Ԃ܂B

#### PopupMenu.set_item_radio_checked(name: str, checked: bool)

ڂ̃WI{^X^C̃`FbNԂݒ肵܂B

* `name`  
  ږw肵܂B

* `checked`  
  ڂ`FbNꍇ `True` A`FbNȂꍇ `False` w肵܂B

#### PopupMenu.get_item_radio_checked(name: str) -> bool

ڂ̃WI{^X^C̃`FbNԂ擾܂B

* `name`  
  ږw肵܂B

* ߂l  
  ڂ`FbNĂꍇ `True` A`FbNĂȂꍇ `False` Ԃ܂B

#### PopupMenu.set_item_enabled(name: str, enabled: bool)

ڂ̗LԂݒ肵܂B
ɂڂ͕\AIłȂȂ܂B

* `name`  
  ږw肵܂B

* `checked`  
  ڂLɂꍇ `True` Aɂꍇ `False` w肵܂B

#### PopupMenu.get_item_enabled(name: str) -> bool

ڂ̗LԂ擾܂B

* `name`  
  ږw肵܂B

* ߂l  
  ڂLȏꍇ `True` Aȏꍇ `False` Ԃ܂B

#### PopupMenu.show(x: int, y: int) -> str
#### PopupMenu.show() -> str

j[|bvAbv\܂B
ꍇ݂͌̃}EXJ[\̈ʒuɕ\܂B

* `x`  
  \鍶ʒuXN[WŎw肵܂B

* `y`  
  \ʒuXN[WŎw肵܂B

* ߂l  
  IꂽږԂ܂B
  ǂ̍ڂIȂꍇ͋󕶎񂪕Ԃ܂B

#### PopupMenu.clear()

j[ڂSč폜܂B

#### PopupMenu.item_count : int (read only)

j[̍ڐłB


### ThumbnailsWindow NX

TlCEBhE\NXłB
`WindowBase` NXhĂ܂B  
`Application.get_thumbnails_window()` ֐܂
`Application.get_active_thumbnails_window()` ֐Ŏ擾ł܂B

#### ThumbnailsWindow.unique_id : int (read only)

EBhEӂɎʂ邽߂ ID łB  
 ID r邱ƂŁA2 `ThumbnailsWindow` IuWFNgEBhE
QƂĂ邩𒲂ׂ邱Ƃł܂B

#### ThumbnailsWindow.folder_count : int (read only)

JĂtH_(^u)̐łB

#### ThumbnailsWindow.get_folder(index: int) -> ThumbnailsFolder

tH_擾܂B

* `index`  
  擾tH_̔ԍw肵܂B
  0  `folder_count` - 1 ̊ԂŎw肵܂B

* ߂l  
  擾 `ThumbnailsFolder` IuWFNgԂ܂B

#### ThumbnailsWindow.set_active_folder_index(index: int)

ANeBuȃtH_ݒ肵܂B

* `index`  
  ݒ肷tH_̔ԍw肵܂B
  0  `folder_count` - 1 ̊ԂŎw肵܂B

#### ThumbnailsWindow.get_active_folder_index() -> int

ANeBuȃtH_̔ԍ擾܂B

#### ThumbnailsWindow.get_active_folder() -> ThumbnailsFolder

ANeBuȃtH_擾܂B

#### ThumbnailsWindow.set_folder_index(index: int, to_index: int)

tH_̏ύX܂B

* `index`  
  ςtH_̔ԍw肵܂B
  0  `folder_count` - 1 ̊ԂŎw肵܂B

* `to_index`  
  ړ̈ʒuw肵܂B
  0  `folder_count` ̊ԂŎw肵܂B

#### ThumbnailsWindow.open_folder(path: str) -> ThumbnailsFolder

tH_J܂B

* `path`  
  JtH_̃oXw肵܂B

#### ThumbnailsWindow.do_action(action: str)

@\s܂B

* `action`  
  s@\\w肵܂B
  wł镶́ATlCEBhẼj[ [wv] -> [R}hꗗ] ŊmFł܂B


### ThumbnailsFolder NX

TlC̃tH_(^u)\NXłB  
`ThumbnailsWindow.get_folder()` ֐܂
`ThumbnailsWindow.get_active_folder()` ֐Ŏ擾ł܂B

#### ThumbnailsFolder.unique_id : int (read only)

tH_ӂɎʂ邽߂ ID łB  
 ID r邱ƂŁA2 `ThumbnailsFolder` IuWFNgtH_
QƂĂ邩𒲂ׂ邱Ƃł܂B
tH_JĂꍇ́Aꂼ̃tH_ɈقȂlɂȂ܂B

#### ThumbnailsFolder.type : str (read only)

tH_̎ނłBȉ̂ꂩɂȂ܂B

  * "blank"  
    
  * "category"  
    
  * "folder"  
    ʏ̃tH_
  * "search"  
    
  * "stock"  
    XgbN

#### ThumbnailsFolder.path : str (read only)

tH_̃pXłB

#### ThumbnailsFolder.file_system_path : str (read only)

tH_̃t@CVXẽpXłB

#### ThumbnailsFolder.display_path : str (read only)

tH_̕\p̃pXłB

#### ThumbnailsFolder.display_name : str (read only)

tH_̕\p̖OłB

#### ThumbnailsFolder.item_id_list : bytes (read only)

tH_ Item ID List łB

#### ThumbnailsFolder.is_archive : bool (read only)

tH_ɂۂ\܂B

#### ThumbnailsFolder.file_count : int (read only)

\Ăt@C\܂B
tB^KpĂꍇAۂɕ\Ă鐔ɂȂ܂B

#### ThumbnailsFolder.selected_file_count : int (read only)

\IĂt@C\܂B

#### ThumbnailsFolder.get_file(index: int) -> ThumbnailsFile

\Ăt@C擾܂B

* `index`  
  擾t@C̔ԍw肵܂B
  0  `file_count` - 1 ̊ԂŎw肵܂B

* ߂l  
  擾 `ThumbnailsFile` IuWFNgԂ܂B

#### ThumbnailsFolder.unfiltered_file_count : int (read only)

SẴt@C\܂B
tB^KpĂꍇA\̃t@C܂߂ɂȂ܂B

#### ThumbnailsFolder.unfiltered_selected_file_count : int (read only)

SĂ̑IĂt@C\܂B

#### ThumbnailsFolder.get_unfiltered_file(index: int) -> ThumbnailsFile

t@C擾܂B

* `index`  
  擾t@C̔ԍw肵܂B
  0  `unfiltered_file_count` - 1 ̊ԂŎw肵܂B

* ߂l  
  擾 `ThumbnailsFile` IuWFNgԂ܂B

#### ThumbnailsFolder.set_path(path: str, async: bool = True)

tH_̃pXݒ肵܂B  
tH_̓eۂɓǂݍ܂̂́ÃtH_̃^uANeBuȏꍇ݂̂łB  
ȊȌꍇAŏɃANeBuɂꂽ load ֐Ă΂ꂽ_œǂݍ܂܂B

* `path`  
  ݒ肷pXw肵܂B

* `async`  
  񓯊œǂݍނۂw肵܂B  
  `False` ̏ꍇAœǂݍ܂Aǂݍ݂܂Ŗ߂܂B
  `True` ̏ꍇA񓯊œǂݍ܂Aǂݍ݂Oɖ߂܂B

#### ThumbnailsFolder.close()

tH_܂B
Ō 1 ̃tH_͕܂B

#### ThumbnailsFolder.refresh(async: bool = True)

tH_ŐV̏ɍXV܂B

* `async`  
  񓯊ōXV邩ۂw肵܂B  
  `False` ̏ꍇAōXVAXVI܂Ŗ߂܂B
  `True` ̏ꍇA񓯊ōXVAXVIOɖ߂܂B

#### ThumbnailsFolder.load(async: bool = True)

tH_̓eǂݍ݂܂B  
ʏtH_͍ŏɕ\鎞ɓǂݍ܂܂B
܂\ĂȂtH_́Å֐Ăяoēǂݍ܂ȂƂȂ܂B

* `async`  
  񓯊œǂݍނۂw肵܂B  
  `False` ̏ꍇAœǂݍ܂Aǂݍ݂܂Ŗ߂܂B
  `True` ̏ꍇA񓯊œǂݍ܂Aǂݍ݂Oɖ߂܂B

#### ThumbnailsFolder.is_loaded : bool (read only)

tH_̓eǂݍ܂Ă邩ۂ\܂B  
ʏtH_͍ŏɕ\鎞ɓǂݍ܂܂B
܂\ĂȂtH_ł `False` ɂȂ܂B

#### ThumbnailsFolder.group : int

^uO[v\܂B
-1 ŃO[vȂA0`11 ŃO[v̔ԍ\܂B


### ThumbnailsFile NX

TlC̃t@C\NXłB  
`ThumbnailsFolder.get_file()` ֐܂́A
`ThumbnailsFolder.get_unfiltered_file()` ֐Ŏ擾ł܂B

#### ThumbnailsFile.unique_id : int (read only)

t@CӂɎʂ邽߂ ID łB  
 ID r邱ƂŁA2 `ThumbnailsFile` IuWFNgt@C
QƂĂ邩𒲂ׂ邱Ƃł܂B
tH_JĂꍇ́At@C̎Ԃł
ꂼ̃tH_ɈقȂlɂȂ܂B

#### ThumbnailsFile.path : str (read only)

t@C̃pXłB

#### ThumbnailsFile.file_system_path : str (read only)

t@C̃t@CVXẽpXłB

#### ThumbnailsFile.display_path : str (read only)

t@C̕\p̃pXłB

#### ThumbnailsFile.display_name : str (read only)

t@C̕\p̖OłB

#### ThumbnailsFile.item_id_list : bytes (read only)

t@C Item ID List łB

#### ThumbnailsFile.file_size : int (read only)

t@C̃TCY(oCgP)łB

#### ThumbnailsFile.created_time : datetime (read only)

t@C̍쐬(UTC)łB

#### ThumbnailsFile.modified_time : datetime (read only)

t@C̍XV(UTC)łB

#### ThumbnailsFile.is_folder : bool (read only)

tH_ł邩ۂ\܂B

#### ThumbnailsFile.is_archive : bool (read only)

ɂł邩ۂ\܂B

#### ThumbnailsFile.is_in_archive : bool (read only)

ɓ̃t@Cł邩ۂ\܂B

#### ThumbnailsFile.selected : bool

IԂ\܂B

#### ThumbnailsFile.marking : int

}[NԂ\܂B
-1 Ń}[NA0`11 Ń}[N̔ԍ\܂B

#### ThumbnailsFile.set_user_property(name: str, value: Any) -> bool

[U[vpeBݒ肵܂B

* `name`  
  vpeBw肵܂Bwł閼O `Document` NX `set_user_property` ̉QƂĂB

* `value`  
  ݒ肷lw肵܂B`None` w肷ƃvpeB폜܂B

* ߂l  
  ɃvpeBݒ肳ꂽꍇ `True` AݒłȂꍇ͏ꍇ `False` Ԃ܂B

#### ThumbnailsFile.get_user_property(name: str) -> Any

[U[vpeB擾܂B

* `name`  
  vpeBw肵܂Bwł閼O `Document` NX `set_user_property` ̉QƂĂB

* ߂l  
  vpeB̒lԂ܂BvpeB݂Ȃꍇ `None` Ԃ܂B

#### ThumbnailsFile.set_user_properties(properties: Dict) -> bool

ׂẴ[U[vpeBݒ肵܂B

* `properties`  
  ݒ肷vpeBL[ƂĂ̒li[ dict w肵܂B  
  włvpeB `Document` NX `set_user_property` ̉QƂĂB  
  w肳ꂽ dict ɑ݂ȂvpeB͍폜܂B  
   dict w肷ƁAׂẴvpeB폜܂B

* ߂l  
  ɃvpeBݒ肳ꂽꍇ `True` AݒłȂꍇ͏ꍇ `False` Ԃ܂B

#### ThumbnailsFile.get_user_properties() -> Dict

ׂẴ[U[vpeB擾܂B

* ߂l  
  vpeBL[ƂĂ̒li[ dict Ԃ܂B  
  płvpeB `Document` NX `set_user_property` ̉QƂĂB


## XV

* rev.0.4.4 (PictureFan ver.0.58.0)
  * Image NX set_/get_metadata  XMP ̐ݒƎ擾ɑΉ

* rev.0.4.3 (PictureFan ver.0.51.0)  2022/12/4
  * Document  ThumbnailsFile NXɈȉ̃oǉ
    * set_user_property
    * get_user_property
    * set_user_properties
    * get_user_properties
  * WindowBase NX activate ֐ǉ

* rev.0.4.2 (PictureFan ver.0.47.0)  2022/3/19
  * ThumbnailsFolder NX type vpeBǉ

* rev.0.4.1 (PictureFan ver.0.44.0)  2021/7/23
  * Application NX run_event vpeBǉ
  * Application.run_context  Application ǉ

* rev.0.4.0 (PictureFan ver.0.43.0)  2021/1/24
  * Viewer NXǉ
  * Application NXɈȉ̃oǉ
    * get_current_document
    * viewer_count
    * get_viewer
    * get_active_viewer
    * open_viewer
  * Application.run_context  Viewer ǉ
  * Document NX do_action ֐ǉ

* rev.0.3.3 (PictureFan ver.0.41.0)  2020/2/2
  * Document NX selected vpeB get_/set_selected_rect ֐ǉ

* rev.0.3.2 (PictureFan ver.0.39.0)  2019/7/28
  * ThumbnailsFolder NX group vpeBǉ
  * ThumbnailsWindow NX set_folder_index ֐ǉ

* rev.0.3.1 (PictureFan ver.0.38.0)  2019/4/22
  * ThumbnailsFolder.set_path/load  async ǉ

* rev.0.3.0 (PictureFan ver.0.37.0)  2019/2/24
  * XNvǧ Python ɕύX

* rev.0.2.2 (PictureFan ver.0.25.0)  2012/11/4
  * Image IuWFNg Resize  lanczos2/3/4 ǉ

* rev.0.2.1 (PictureFan ver.0.23.0)  2010/8/2
  * Image IuWFNg Rotate ̈ resample  back_color ǉ  
    ܂Apx̎w𐮐畂_ɕς
  * Image IuWFNg Resize  lanczos8 ǉ
  * ̃TvR[hɊԈႢ̂C

* rev.0.2.0 (PictureFan ver.0.20.0)  2010/2/21
  * 48/64rbg摜ɑΉ
  * Image IuWFNgɈȉ̃oǉ
    * BitsPerPlane
    * PlanesPerPixel
    * To48Bits
    * To64Bits
  * Color IuWFNgɈȉ̃oǉ
    * SetRGB16
    * Red16
    * Green16
    * Blue16
    * Alpha16

* rev.0.1.0 (PictureFan ver.0.16.0)  2009/10/5
  * ŏ̃o[W


[EOF]