Questions tagged [gd2]

GD2 as well as GD are open source code libraries for the dynamic creation of images by programmers. GD2 is the improved version of GD and a widely used standard. For example, GD2 in included in PHP 5.

GD2 as well as are code libraries for the dynamic creation of images by programmers. GD2 is the improved version of and a widely used standard. For example, GD2 in included in .

Useful Links:

104 questions
115
votes
8 answers

Convert SVG image to PNG with PHP

I'm working on a web project that involves a dynamically generated map of the US coloring different states based on a set of data. This SVG file gives me a good blank map of the US and is very easy to change the color of each state. The…
Michael Berkompas
  • 2,552
  • 3
  • 17
  • 22
34
votes
4 answers

How to stop GD2 from washing away the colors upon resizing images?

I have developed a photo sharing community site using CodeIgniter 1.7. Photos that are uploaded by members are automatically resized in a number of formats, for which I use the CodeIgniter Image Manipulation class. This class is built into the…
Fer
  • 3,794
  • 13
  • 52
  • 98
11
votes
3 answers

Does the GD2 extension come with PHP?

Does the GD2 extension come with PHP by default? If yes, since what version does it happen? Is it enabled by default? thanks (:
Hugo Mota
  • 9,751
  • 9
  • 38
  • 55
9
votes
7 answers

Magento resize() image quality: dirty white background

I have a client who is seriously unhappy with the way their product thumbnails are rendering on Magento. The dodgy appearance is noticeable on two accounts: there is a dirty white background which has very light grey horizontal lines and secondly…
digiwig
  • 637
  • 1
  • 7
  • 21
7
votes
3 answers

how handling image's mime type "application/octet-stream"?

I have a function to make thumbnail of a url image on fly! I always pass to this functions images with type jpg, but the problem appears when I pass an image with ".jpg" extension. but when i try to get its mime type, i found that's…
user504363
  • 481
  • 2
  • 11
  • 24
7
votes
2 answers

How to speed up image resizing in a CodeIgniter PHP application?

I have an application that allows users to upload images. The test case I use is a jpeg of 1.6MB with dimensions 3872 x 2592px. The upload script in the back-end will resize the uploaded image into 6 additional formats: square (small 75 x 75) Small…
Fer
  • 3,794
  • 13
  • 52
  • 98
5
votes
1 answer

Enable GD support in PHP

I'm trying to install pixelpost on an Apache server on windows. The installer is failing because: Pixelpost will not run if your PHP installation is not compiled with the GD graphics library. I've added the following line to…
Dónal
  • 176,670
  • 166
  • 541
  • 787
5
votes
2 answers

PHP GD2: how to maintain alpha channel transparency and correct gamma

I was intrigued by this discussion of image scaling and subsequently found out that the PHP code I'm using to create thumbnails from uploaded images suffers from the same problem. I decided to try the PHP fix posted near the bottom (converting gamma…
Ty W
  • 6,406
  • 4
  • 26
  • 34
4
votes
2 answers

What are the differences between a GD and a GD2 image?

Reading the documentation for imagegd2(), and imagegd(), I noticed the functions are described, respectively as: Output GD2 image to browser or file Output GD image to browser or file What are a GD2, and a GD image? What are the difference between…
DEVOPS
  • 16,170
  • 29
  • 91
  • 115
4
votes
1 answer

Codeigniter thumbnail image path can not be stored in MySql

I am trying to make a simple app with Codeigniter where i need to store thumbnail image path in MySql database. The images along with the thumbnail versions upload correctly in the upload folder and I can store the image path in my database while…
4
votes
1 answer

How to compress images in CodeIgniter, yet do not change their dimensions?

I have a site where users can upload images. I process these images directly and resize them into 5 additional formats using the CodeIgniter Image Manipulation class. I do this quite efficiently as follow: I always resize from the previous format,…
Fer
  • 3,794
  • 13
  • 52
  • 98
4
votes
4 answers

PHP Imagick - convert image to greyscale (very bad result)

I was doing some image editing with PHP, since GD provides less functionalities, I switched to Imagick. One of the processes is to greyscale images. Everything went fine (locally on Windows 7, Imagick 2.2.1-dev 6.5.8-7 Q16) till I uploaded the…
user1643156
  • 3,657
  • 10
  • 34
  • 58
3
votes
5 answers

PHP Merge jpeg on top of png with alpha transparency

I am trying to put a jpeg behind a png - where the png has alpha transparency. The foreground image is here: http://peugeot208.srv.good-morning.no/images/marker-shadow.png The image behind is a facebook profile image - typically like this:…
nitech
  • 1,792
  • 2
  • 20
  • 33
3
votes
4 answers

How to allow upload transparent gif or png with php

I have this function below to allow me to resize my uploaded image, function resize_image($image,$width,$height,$scale) { list($imagewidth, $imageheight, $imageType) = getimagesize($image); $imageType = image_type_to_mime_type($imageType); …
laukok
  • 47,545
  • 146
  • 388
  • 689
3
votes
1 answer

I can flip images horizontally/vertically, but I can't rotate them with the GD2 library

I am developing a feature to allow an image to be rotated in increments of 90 degrees or to be flipped horizontally or vertically. I have the code working just fine on my own computer, but when uploaded to a live server, the rotate functionality…
JGDev
  • 261
  • 1
  • 4
  • 8
1
2 3 4 5 6 7