承接 thies/gameboy-camera-image-extractor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thies/gameboy-camera-image-extractor

最新稳定版本:1.1.2

Composer 安装命令:

composer require thies/gameboy-camera-image-extractor

包简介

This is a PHP library for extracting Game Boy Camera photos from a save ram (.sav) file and writing them in various image formats.

README 文档

README

This is a PHP library for extracting Game Boy Camera photos from a save ram (.sav) file and writing them in various image formats.

The library requires the GD php extension to work.

To see it in action go to https://gbcamera.net

Basic usage

To just extract the images and store them on disk use the image writer:

$imageWriter = new \GameboyCameraImageExtractor\ImageWriter();
$imageWriter->extractAndStoreToDisk('/path/to/file.sav', '/output/directory');

By default, it outputs the images in PNG format. There are multiple adapter available for different image formats. For example, if you want to output the images in webp format you can use the Webp adapter:

$webpAdapter = new \GameboyCameraImageExtractor\Writer\Webp();
$imageWriter = new \GameboyCameraImageExtractor\ImageWriter($webpAdapter);
$imageWriter->extractAndStoreToDisk('/path/to/file.sav', '/output/directory');

It will output the images in webp format. You can also extend \GameboyCameraImageExtractor\Writer\Writer and write you own implementation for your specific needs.

If you want to get the images without writing them to disk you can use the image extractor:

$imageExtractor = new \GameboyCameraImageExtractor\ImageExtractor();
$imageExtractor->extractFromFile('/path/to/file.sav');

This will return an array of \GdImage objects.

Palettes

You can also use palletes to give the image a bit more color.

Basic usage:

$palette = new \GameboyCameraImageExtractor\Entity\Palette('#ffffff', '#cccccc', '#666666', '#000000');
$imageWriter = new \GameboyCameraImageExtractor\ImageWriter();
$imageWriter->extractAndStoreToDisk('/path/to/file.sav', '/output/directory', $palette);

There are some presets, I might add some more at a later time.

$preset = \GameboyCameraImageExtractor\Enum\PalettePreset::GameboyPlayer;
$palette = \GameboyCameraImageExtractor\Entity\Palette::createForPreset($preset);

Credits

I could not have made this without the works of raphnet: https://github.com/raphnet/gbcam2png

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固