Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP PNG images become black colored during create image

Have Programming Question? Ask it here!
 
 
 


ketan patil
PNG images become black colored during create image
0 Answer(s)      a year and 4 months ago
Posted in : PHP


if($sFileExtension == "PNG" || $sFileExtension == "png")
{
$img1 = @imagecreatefrompng($file);
}
else
{
    $img1 = imagecreatefromjpeg($file);
}
$width1 = @imagesx($img1);
$height1 = @imagesy($img1);
if ($width1 > $height1)
{
    $y1 = 0;
    $x1 = ($width1 - $height1) / 2;
    $smallestSide1 = $height1;
}
else
{
    $x1 = 0;
    $y1 = ($height1 - $width1) / 2;
    $smallestSide1 = $width1;
}
$thumbSize1 = 160;
$thumb1 = imagecreatetruecolor($thumbSize1, $thumbSize1);

imagecolortransparent($thumb1, imagecolorallocatealpha($thumb1, 255, 255, 255, 127));
imagealphablending($thumb1, false);
imagesavealpha($thumb1, true);
@imagecopyresampled($thumb1, $img1, 0, 0, $x1, $y1, $thumbSize1, $thumbSize1, $smallestSide1, $smallestSide1);

if($sFileExtension == "PNG" || $sFileExtension == "png")
{
    imagepng( $thumb1, $file);//third parameter is $quality its option
}
else
{
    imagejpeg( $thumb1, $file);//third parameter is $quality its option
}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
PNG images become black colored during create image
PNG images become black colored during create image  if($sFileExtension == "PNG" || $sFileExtension == "png") { $img1 = @imagecreatefrompng($file..., $smallestSide1); if($sFileExtension == "PNG" || $sFileExtension == "png") { imagepng
how to re size image proportionately using java for different images like jpeg, png, gif.
how to re size image proportionately using java for different images like jpeg, png, gif.  hi, i need sample code for re size image proportionately using java for different images like jpeg, png, gif, this code for my
Advertisements
How to change the color of a base64-encoded png image JQuery?
How to change the color of a base64-encoded png image JQuery?  I am going to change the colors of the pixels of a png image(which is in base64 format...;; //"data:image/png
Retrieving images from the oracle database using jsp and create that rretrieved image as hyperlink
Retrieving images from the oracle database using jsp and create that rretrieved image as hyperlink  I want to insert images into oracle database.I want to retrieve images using jsp and I want to display on the browser.The
Convert Black & White Image to Color Image
Convert Black & White Image to Color Image       How to convert a black and white photograph... black and white image to add color. Go to image > Adjustment > Color Balance
PNG and JPG
PNG and JPG  hii, When to use PNG or JPG in iPhone development?   PNG's are pixel perfect (non-lossy), and require very little extra CPU... process. But the typical compression and image quality is usually quite sufficient
combining 5 images and text in between to one single image in java
combining 5 images and text in between to one single image in java  Hi I have to combine 5 images and text in between to one single image. I have... and create and single image for download. any help would be appreciated. Thank you
PHP GD Library, PHP GD Tutorial
The PHP GD Library is one of the most used image-processing libraries used in the PHP programs. IT is one of the robust library to create GIF, JPG and PNG images through PHP program. You can use this library to create, create thumbnail
noise during print screen
noise during print screen  hi there, i have a java program which can print screen every 1 seconds... but during the print screen, the image seems will have some noise and ends up half page of the image will be black screen
PHP GD Image into black and white
-type: image/jpeg;"); $i->imagejpeg(); class imagethumbnail { var $filename; var $x; var $y; var $image; var $thumbnail; function... ($imageinfo[2]) { case "1": $this->image = imagecreatefromgif
create dynamic image gallery jquery
create dynamic image gallery jquery  How to create a dynamic image gallery in Jquery
images
images  code for displaying image in java swings
How to make an animated black & white focus on the color photograph, animated black & white focus on the color photograph
How to make an animated black & white focus on the color photograph... interesting because I have tried here to make a black and white focus on the colored picture. Take a picture: First take colored picture to modify. Draw a circle
Animating Images in Java Application
images. Image are given below: In this program, images are displayed one... has been used to show images on the frame one by one during the 1000... Animating Images in Java Application   
uistatusbarstyle black translucent is not available on this device
uistatusbarstyle black translucent is not available on this device  .... And i am displaying images in a scroll view, i get this error while view get loads. uistatusbarstyle black translucent is not available on this device
How to create a JTable cell containing Image hyperlink?
How to create a JTable cell containing Image hyperlink?  I'm trying to find out how to create a JTable cell which contains Image, which should be clickable like an hyperlink. I'm able to load Image using default image renderer
How to Become a Business Analyst
How to Become a Business Analyst  How to Become a Business Analyst
Black Berry Programming - MobileApplications
Black Berry Programming  Hi friends i would like to build an application for blackberry thats creating a radio for that blackberry it as to work with the GPRS will any one give guidence for me i am learner now i know some
This is 26 set of different shades of Black covers light brown to darker Black.
:5px 0px 5px 5px; } This is 26 set of different shades of Black covers light brown to darker Black. Name/String Code Name Code Black 1 #000000 Black 2 #0B0000
Image Size
file name that has the extension either GIF, JPEG or PNG and returns an image... Image Size       This Java awt (Abstract Windowing Toolkit) tutorial describes about the image size
HOW TO BECOME A GOOD PROGRAMMER
HOW TO BECOME A GOOD PROGRAMMER  I want to know how to become good programmer   Hi Friend, Please go through the following link: CoreJava Tutorials Here you will get lot of examples with illustration where you can
pngcrush caught libpng error not a png file
pngcrush caught libpng error not a png file  What is " pngcrush caught libpng error not a png file " error that occurs while running my app in simulator
how to create menubar and the below background color/image in java swing
how to create menubar and the below background color/image in java swing  how to create menubar and the below background color/image in java swing
images upload
images upload  I use netbeans IDE 6.8 How i upload any image from any folder to web page
How to color an object in the black white photograph, color an object in the black white photograph,
How to color an object in the black & white photograph... object in the black and white photograph, follow all the steps that are shown in this example. Take picture: First we have to capture any black
php gd image create from string
' . '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg=='; $String = base64_decode($String); $image = imagecreatefromstring($String); if ($image !== false) { header('Content-Type: image/png'); imagepng($image); } else { echo 'An error occured.'; } ?> After running
How to become a PHP Developer?
In this section we will show you the steps you need to follow to become a good... to become a PHP Developer. You will definitely find this step-by-step tutorial very.... To become a PHP developer following the following steps: How to become PHP
PHP GD transparent png
($im, 255, 0, 0); $black = imagecolorallocate($im, 0, 0, 0); imagecolortransparent($im, $black); imagefilledrectangle($im, 4, 4, 50, 25, $red...;Transparent image created and saved successfully."); ?> After
Images in java
Images in java  how to handle images in java
Image Control in Flex4
, PNG and SWF file. You can import these files in your application using Image control. Flex importing GIF, JPEG, PNG, and SWF files at run time...Image control in Flex4: The Image Control is a MX component. It has no Spark
jsp images
jsp images  hi I had done a demo application using jsp. And i tried to display some images which is located in the server folder. It has done by using the IP address path of that image folder.. It has been success full in IE
Image Demo
Image Demo       This section simply display the image demo that means multiple images and its name are based on the frame to a particular location. For displaying images demo
Java Script With Links and Images
of JavaScript and create your first JavaScript program. JavaScript Images... that need to be edited to create JavaScript image swapping.  The JavaScript..., in this case black) then changes to display a second image in this place.  
background images in css not working
background images in css not working  In the application i'm passing a background image from CSS in the given format ... background-image: url("Image\backgroundImage.GIF"); which is not working. So, please give me an example
Moving The Images
Moving The Images  How to moving multiple images in one frame using swings
inked images
inked images  How do I eliminate the blue border around linked images
JList Background Images..Urgent
JList Background Images..Urgent  I has done a JList that can change... image rather than background colors, how can i do it? Please help! my previous...; private Container container; private final String colorNames[]={"Black","Blue
Displaying images using Javascript
Displaying images using Javascript... to display images using javascript and css.For this we are going to make program named image-slideshow-5. css,image-slideshow-5.html,image-slideshow-5.js.The code
Images - BufferedImage
is used to create images in memory. You might want to do this for unchanging images that take a long time to create. You can create them once, then display them... for transparency, but rendering images which do not use the the native image model
Java Write To Image File Example
need to do the following At first create an instance of your original Image file as /* Create new Image File Object */ File origionalImage = new File("myImage.jpg"); Create an ImageBuffer object of Origional Image as /* Read
images - JDBC
images  i have image if someone click on image it will display big but the problem is i want a bye link button on that page ..  Hi Friend...('image').style.visibility = 'hidden'; } } Bye Hope
image processing - Java3D
image processing  hii i have to compare 2 images. for this i try to convert image into greyscale. i think the greyscale comparisonn is more.... The sample code below shows how to draw the colored image to a gray scale
PHP GD Image Resize
= imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100); echo("Image created
Adding images in itext pdf
Adding images in itext pdf  Hi, How to add image in pdf file using itext? Thanks   Hi, You can use following code... image in the pdf file. Thanks
PHP GD image Character up
.'; $bg = imagecolorallocate($im, 255, 0, 0); $black = imagecolorallocate($im, 0, 0, 0); imagecharup($im, 5, 13, 13, $string, $black); header('Content-type: image/png'); imagepng($im); ?> After running the program you
How to display multiple images in jsp
How to display multiple images in jsp  <%@ page import="java.io.... = stmt.executeQuery("select IMAGE from student_profile "); //ResultSet rs1=stmt.executeQuery...()); System.out.println("st-7 "+brr); // display the image response.setContentType("image
HTML Post Image
to insert images in html. For this we create a html page name image.htm. The code... HTML Post Image       The Tutorial illustrates an example, how to post image in HTML
dyanamic upload of images using struts without database connection
dyanamic upload of images using struts without database connection  I want to upload images dynamically with out using data base..and want to create image for every user in my db
regarding images in jsp
regarding images in jsp  Hi, When I am trying to display an image in jsp, i am getting the image of bar charts in webroots/jspchart/web/jspbarchart.jsp.. But actually I am not getting any image in the browser.. Can any one help
Images - ImageIcon
), use ImageObserver. Unless you are loading many images, or a large image... Java NotesImages - ImageIcon javax.swing.ImageIcon is used for images... formats are .gif, .jpg, and .png. Choice: Wait until loaded or overlap loading
Advertisements
 

 

 

DMCA.com