CompressionLevel
ExportおよびCreateArchiveのオプションで,データを圧縮する際の圧縮量を指定する.
詳細
- 次は,CompressionLevelのよく使われる設定値である.
-
Automatic 自動選択 val 0 (あまり圧縮しない)から1(より圧縮する )までの数 - CompressionLevelAutomaticを使うと速度とデータサイズのバランスが取られる.
例題
すべて開く すべて閉じる例 (1)
デフォルトの圧縮で音声オブジェクトをMP3ファイルにエキスポートする:
audio = AudioGenerator["Sin"]FileSize@Export["file.mp3", audio]FileSize@Export["file.mp3", audio, CompressionLevel -> 1]FileSize@Export["file.mp3", audio, CompressionLevel -> 0]スコープ (5)
画像圧縮 (2)
デフォルトの圧縮で画像オブジェクトをJPEGファイルにエキスポートする:
image = ExampleData[{"TestImage", "Apples"}];FileSize@Export["file.jpeg", image]FileSize@Export["file.jpeg", image, CompressionLevel -> 1]FileSize@Export["file.jpeg", image, CompressionLevel -> 0]FileByteCount[file = FileNameJoin[{$InstallationDirectory, "Documentation", "English", "System", "ExampleData", "coneflower.jpg"}]]FileByteCount[archive = CreateArchive[file]]DeleteFile[archive]FileByteCount[archive = CreateArchive[file, CompressionLevel -> 0]]DeleteFile[archive]FileByteCount[archive = CreateArchive[file, CompressionLevel -> 1]]DeleteFile[archive]音声圧縮 (1)
デフォルトの圧縮レベルで音声オブジェクトをMP3ファイルにエキスポートする:
audio = AudioGenerator["Sin"]FileSize@Export["file.mp3", audio]FileSize@Export["file.mp3", audio, CompressionLevel -> 1]FileSize@Export["file.mp3", audio, CompressionLevel -> 0]動画圧縮 (2)
CompressionLevelオプションを使って動画操作におけるファイルサイズを制御する:
v = VideoGenerator[ResourceData["Sample Image: White Dog on a Beach"], 5];a = ExampleData[{"Audio", "PianoScale"}];i = ResourceData["Sample Image: White Dog on a Beach"];
videos = Table[VideoCombine[{v, a}, CompressionLevel -> c], {c, 0, 1, .2}]FileSize[Information[#, "ResourcePath"]]& /@ videosv = Video["ExampleData/Caminandes.mp4"];FileSize[FindFile[Information[v, "ResourcePath"]]]FileSize[FindFile[Information[VideoTrim[v, 10], "ResourcePath"]]]FileSize[Information[VideoTrim[v, 10, CompressionLevel -> 1], "ResourcePath"]]Information[v, "VideoTracks"]FileSize[Information[VideoTrim[v, 10, VideoEncoding -> "LIBVPX-VP9"], "ResourcePath"]]FileSize[Information[VideoTrim[v, 10, VideoEncoding -> "LIBVPX-VP9", CompressionLevel -> 1], "ResourcePath"]]関連するガイド
-
▪
- 音声形式
テキスト
Wolfram Research (2020), CompressionLevel, Wolfram言語関数, https://reference.wolfram.com/language/ref/CompressionLevel.html.
CMS
Wolfram Language. 2020. "CompressionLevel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompressionLevel.html.
APA
Wolfram Language. (2020). CompressionLevel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompressionLevel.html
BibTeX
@misc{reference.wolfram_2026_compressionlevel, author="Wolfram Research", title="{CompressionLevel}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/CompressionLevel.html}", note=[Accessed: 10-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_compressionlevel, organization={Wolfram Research}, title={CompressionLevel}, year={2020}, url={https://reference.wolfram.com/language/ref/CompressionLevel.html}, note=[Accessed: 10-September-2026]}