i have the following code to crop an image in a circle with transparent borders..
// create the transparent circle image
$filename = APP_WEB_PATH."img/user/".$_GET['img'].".jpg";
$imagefilenamepng = APP_WEB_PATH."img/user/".$_GET['img']."[login to view URL]";
$image_s = imagecreatefromstring(file_get_contents($filename));
$width = imagesx($image_s);
$height = imagesy($image_s);
$newwidth = 300;
$newheight = 300;
$image = imagecreatetruecolor($newwidth, $newheight);
imagealphablending($image, true);
imagecopyresampled($image, $image_s, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
//create masking
$mask = imagecreatetruecolor($newwidth, $newheight);
$transparent = imagecolorallocate($mask, 255, 0, 0);
imagecolortransparent($mask,$transparent);
imagefilledellipse($mask, $newwidth/2, $newheight/2, $newwidth, $newheight, $transparent);
$red = imagecolorallocate($mask, 0, 0, 0);
imagecopymerge($image, $mask, 0, 0, 0, 0, $newwidth, $newheight, 100);
imagecolortransparent($image,$red);
imagefill($image, 0, 0, $red);
imagepng($image,$imagefilenamepng);
imagedestroy($image);
imagedestroy($mask);
The image looks good and transparent and even when opened with a photo editor [login to view URL]
but when used inside an image using php GDI i get a black border instead of transparent [login to view URL]
if i re save the [login to view URL] using a photo edit such as [login to view URL] and then use it it works just fine [login to view URL]
only bid if you have worked with php gdi and know what to do.. dont waste yours and mine with a general bid
Hello! I tried your code and resulting image is transparent in the browser. What code do you use for using it inside an image?
I did that, and get output [login to view URL] image with transparent background:
$image_bg = imagecreatefrompng(__DIR__ . '/img/[login to view URL]');
$avatar = imagecreatefrompng(__DIR__ . '/img/user/[login to view URL]');
imagecopy($image_bg, $avatar, 0, 0, 0, 0, 300, 300);
imagepng($image_bg, __DIR__ . '/img/user/[login to view URL]');
$10 USD en 1 jour
5,0 (5 commentaires)
3,7
3,7
13 freelances proposent en moyenne $28 USD pour ce travail
Hello,
★★★★★ 8+ Year's Experience Php Expert ★★★★★
As a preferred freelancer, I can help you to fix the php code. after thoroughly analyzing this job I can assure you that i can do this job easily and swiftly with my knowledge and experience.
I can get this done in few hours.
Let's discuss and start now.
Regards,
Shahnawaz U.
Greetings from Pakistan Mate! I understand that you’re looking for fix the php code.
I am a professional graphic designer bringing in years of experience inPHP, Photo Editing, JavaScript, Photoshop Design and Photoshop for clients across the World.
I recently completed 145 projects to completed and get a 5+ star rating check my portfolio
https://www.freelancer.com/u/SophieAny
Let’s have a quick chat to discuss the project in detail and lock in the final project agreement.
Many thanks,
Anosha
Hello,,
I am interested in your project fix the php code . I am an experienced graphics designer with 8 years of experience in Photo Editing, Photoshop, Photoshop Design, PHP and JavaScript
I have done relevant work like these before as well. Please message me so we can discuss and proceed accordingly.
You can see my work here: https://www.freelancer.com/u/saeedban09
Looking forward to serving you
Hello there!
I am a software developer with 6+ years of experience in developing custom software solutions for businesses. My specialties include web development, database management, and software maintenance.
I have worked on projects for companies in a wide range of industries, including healthcare, finance, retail, and education. I understand the importance of meeting deadlines and delivering high-quality work. I have a proven track record of success and I am committed to exceeding expectations.
If you are looking for a software developer to help you with your project, I would be more than happy to discuss it in further detail. I am confident that I can deliver a quality solution that meets your needs and exceeds your expectations.
Thank you for your time and consideration. I look forward to hearing from you soon.
Sincerely,
Jiwhan Choi
Hello Dear client,
I have read carefully your details and checked the requirements on your project.
I can help you this project. Please contact with me to discuss requirement, I will complete good and fast for you, kind regards.
I have over 5 year of experience In web and app development.
I have skills in PHP / JavaScript / Website Designer etc.
I will assure you 100% work satisfied.
Thanks.
Hey, I’m Raheel Younus a Senior Full Stack Developer, based in Canada. I can fix php codes you have been facing and make it as per require, I am writing to express my strong in being the next Senior Developer for your project. With my skills and background, I am confident that I will quickly surpass your expectations for this role. I have the required skills outlined in the job description, and I am available now.
I have advanced proficiencies in HTML, CSS, and JavaScript, excellent customer service skills, and I am familiar with SQL. I also have a solid foundation in Shopify, MongoDB, Express, React JS, and NodeJS. In addition to five years of work experience.
Regards
Raheel A.
Hello,
As a full stack developer, I have 5 years of experience in developing websites using PHP with MySQL.
HTML, CSS, JAVASCRIPT, JQUERY, SESSION control are not my problem.
I have delivered more than 10 projects built with PHP.
I get into details before proceeding with any work that may end up wasting both parties' time and am efficient, creative, and open-minded to suggest new ideas and alternatives to clients based on what they need as the final product.
I have studied your post and found out that I am well suited for your project implementation.
Regards
Hi!
I reade your requirements you need a good designer who will create aunique style,pattern and good information.
your reading right proposal i wil help you in short interval of time .
i will use in your logo these 5 principle that will make your logo most effective and catch eye.
Simple. Your logo needs to be easily identifiable at a glance. ...
Memorable. An effective logo should be memorable. ...
Timeless. An effective logo should be timeless and should avoid trends. ...
Versatile. A good logo can be used in a variety of sizes and colours. ...
Appropriate.
here is some special service which i will provide you.
1:24/5 Avalibility
2: unlimited reavision
3: Design in just 2 hours
4:Adobe Illustrator (AI)
5:Editable PDF.
6:EPS.
7:SVG.
8:JPEG.
9:PNG.
i hope you like my proposal i will wait for your positive response
is there any Query ask me freely Thanks.