Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/topic.php on line 737
Форумы портала PHP.SU :: imagemagick-ом получить уменьшеную картику лучшего качества

 PHP.SU

Программирование на PHP, MySQL и другие веб-технологии
PHP.SU Портал     На главную страницу форума Главная     Помощь Помощь     Поиск Поиск     Поиск Яндекс Поиск Яндекс     Вакансии  Пользователи Пользователи


 Страниц (1): [1]   

> Без описания
mstdmstd
Отправлено: 31 Марта, 2016 - 14:39:47
Post Id


Частый гость


Покинул форум
Сообщений всего: 170
Дата рег-ции: Авг. 2014  


Помог: 0 раз(а)




Всем привет,
Нужно сделать из большого png-файла файл поменьше максимального качества - даже если он будет больше размером
Я использую команду imagemagick вида:
CODE (htmlphp):
скопировать код в буфер обмена
  1. /usr/bin/convert -sample 1201x847 -density 600   "source_file.png"  -quality 100   "dest_file.png"
Получаю исходный файл но качество хотелось бы получше...

размер выходного файла я задаю явно -sample 1201x847
Понятен параметр -quality 100 - лучшего качества

Сложнее с параметром density
В доке читаю:
Цитата:
-density width
-density widthxheight
Set the horizontal and vertical resolution of an image for rendering to devices.
This option specifies the image resolution to store while encoding a raster image or the canvas resolution while rendering (reading) vector formats such as Postscript, PDF, WMF, and SVG into a raster image. Image resolution provides the unit of measure to apply when rendering to an output device or raster image. The default unit of measure is in dots per inch (DPI). The -units option may be used to select dots per centimeter instead.
The default resolution is 72 dots per inch, which is equivalent to one point per pixel (Macintosh and Postscript standard). Computer screens are normally 72 or 96 dots per inch, while printers typically support 150, 300, 600, or 1200 dots per inch. To determine the resolution of your display, use a ruler to measure the width of your screen in inches, and divide by the number of horizontal pixels (1024 on a 1024x768 display).
If the file format supports it, this option may be used to update the stored image resolution. Note that Photoshop stores and obtains image resolution from a proprietary embedded profile. If this profile is not stripped from the image, then Photoshop will continue to treat the image using its former resolution, ignoring the image resolution specified in the standard file header.
The -density option sets an attribute and does not alter the underlying raster image. It may be used to adjust the rendered size for desktop publishing purposes by adjusting the scale applied to the pixels. To resize the image so that it is the same size at a different resolution, use the -resample option.

Надо ли понимать что нужны параметры монитора клиента screen.width и screen.height ?
Так как написано:
Цитата:
use a ruler to measure the width of your screen in inches, and divide by the number of horizontal pixels (1024 on a 1024x768 display
Не очень понятно какие параметры имеют в виду и как это подсчитать...

Гугля вижу использование параметров вроде sharpen, trim - не очень понятно имеют ли они отношение к качечтву картинок?

Как получить картинку более высокого качества?
 
 Top
Viper
Отправлено: 31 Марта, 2016 - 17:27:49
Post Id



Активный участник


Покинул форум
Сообщений всего: 4555
Дата рег-ции: Февр. 2007  
Откуда: Симферополь


Помог: 98 раз(а)




mstdmstd пишет:
Не очень понятно какие параметры имеют в виду и как это подсчитать...
разрешение экрана монитора, не физические размеры. Также
Цитата:
To resize the image so that it is the same size at a different resolution, use the -resample option.
вам сообщает, что для того чтобы получить картинку того же размера(качества), но другого разрешения, нужно использовать resample.


-----
Список фильмов с описанием, блекджеком и... для Joomla? -> https://киноархив[dot]com
Демо нового движка для сайта php.su -> php[dot]su, проект на гитхабе
 
 Top
Страниц (1): [1]
Сейчас эту тему просматривают: 0 (гостей: 0, зарегистрированных: 0)
« Графика в PHP »


Все гости форума могут просматривать этот раздел.
Только зарегистрированные пользователи могут создавать новые темы в этом разделе.
Только зарегистрированные пользователи могут отвечать на сообщения в этом разделе.
 



Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB