PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 18, 2022

[FIXED] How to change html body color created by php header content image?

 September 18, 2022     imagemagick, imagick, php     No comments   

Issue

I have created an in image using PHP. I want to change the body background color created by php imagick. For more clarification, I have added code and output image.

header('Content-Type: image/png');
$image = new Imagick('d.png');
$image->setImageFormat("png");

echo $image;

enter image description here enter image description here


Solution

It can be easily solved using two seperate file html and php.

page.html

<html>
<body>
    <img src="image.php" alt="" />
</body>
</html>

image.php

<?php

header('Content-Type: image/png');
$im = new Imagick('image.png');

$im->setImageFormat("png");

echo $im;

?>


Answered By - Mouri
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing