dsj60862 2014-12-31 21:35
浏览 45

在php中调整没有像素化的小图像

I'm working on a PHP project where I need to resize images before storing them, I'm using this tool "Oberto/php-image-magician" [https://github.com/Oberto/php-image-magician].

The problem is that resizing small images to higher dimensions results in very bad pixelation, so i want to resize images by adding some dummy black area around the image (like facebook) not through the default resize algorithm, is there any useful plugin or naive algorithm for doing this?

example source img: http: //www.mediafire.com/convkey/c81e/1eheaa31t8zg0c7zg.jpg?size_id=3

what "Oberto/php-image-magician" makes: http: //www.mediafire.com/convkey/c361/jsgc56ji2mw7414zg.jpg?size_id=4

what i want: http: //www.mediafire.com/convkey/988e/8dd31zcvdqzjoc7zg.jpg?size_id=4

thanks in advance

  • 写回答

1条回答 默认 最新

  • drn9573 2014-12-31 21:58
    关注

    http://php.net/manual/en/function.imagecopymerge.php

    As Monkey Zeus pointed out, just create a background image and then overlay your source image.

    评论

报告相同问题?

悬赏问题

  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程