• About us
  • Advertising
  • Send Press Release
  • ICT Indicators
Sunday, April 2, 2023
  • Login
TechSansar.com • Nepal Information and Technology Navigator Website from Nepal
  • Startups
  • Tech Events
    • Submit Tech Events in Nepal
  • Services
    • Shop
    • Web hosting Features
    • Projects initiated by Team TechSansar
    • Windows Apps developed by Team TechSansar
  • Top Posts
    • ICT Organizations in Nepal
    • Top Websites in Nepal
    • Trending Topics related to Nepal
    • Wi-Fi Access Directory Nepal
    • SEO Guide to Nepalese Bloggers – नेपाली ब्लगरहरुलाई SEO सम्बन्धि सुझावहरु
  • Market
    • LG TV Prices
    • Galaxy Tablet Prices
    • Samsung TV Prices
  • Categories
    • Gadgets
    • Nepali IT
    • Telecom
    • Freebies
  • QnA
    • Ask a Question
  • नेपाली संस्करण
Shop
TechSansar.com • Nepal Information and Technology Navigator Website from Nepal
  • Startups
  • Tech Events
    • Submit Tech Events in Nepal
  • Services
    • Shop
    • Web hosting Features
    • Projects initiated by Team TechSansar
    • Windows Apps developed by Team TechSansar
  • Top Posts
    • ICT Organizations in Nepal
    • Top Websites in Nepal
    • Trending Topics related to Nepal
    • Wi-Fi Access Directory Nepal
    • SEO Guide to Nepalese Bloggers – नेपाली ब्लगरहरुलाई SEO सम्बन्धि सुझावहरु
  • Market
    • LG TV Prices
    • Galaxy Tablet Prices
    • Samsung TV Prices
  • Categories
    • Gadgets
    • Nepali IT
    • Telecom
    • Freebies
  • QnA
    • Ask a Question
  • नेपाली संस्करण
TechSansar.com • Nepal Information and Technology Navigator Website from Nepal
No Result
View All Result

Create Watermark of image using PHP

2 years ago
in How To, Software, Tips & Tricks, Tutorials
Reading Time: 4 mins read
0 0
A A
0
watermark using php
Share on FacebookShare on TwitterShare on LinkedInQR Code

Creating a watermark for normal individuals is not an easy task. For a professional designer, it is an easier task to do. Let’s create a system that will help you create an image with a watermark in just a minute of time using PHP. We decide to use PHP as it is one of the most popular programming language in the context of Nepal.

Doing it on the local machine requires xampp or wamp or lamp or mamp. The purpose of using one of these is they provide PHP and Apache server to work locally.

Step 1: Loading the images

$logo = imagecreatefrompng('logo.png');
$image = imagecreatefrompng('image.png');
here we are using the PHP function imagecreatefrompng, which is used to create a new image from the given URL. In our context, the two images are in the same directory of the index.php file.

Step 2: Getting the height and width along with the margins

$margin_right = 500;
$margin_bottom = 350;
$img_width = imagesx($logo);
$img_height = imagesy($logo);
here we are using another PHP function called imagesx and imagesy.  imagesx has been used to get the image width and imagesy to get the image height.

Step 3: Positioning the image and aligning the logo as per the calculation

imagecopy($image, $logo, imagesx($image ) - $img_width - $margin_right, imagesy($image) - $img_height - 
$margin_bottom, 0, 0, imagesx($logo), imagesy($logo));

here we are positioning the image that we want to use as a watermark over another.

Step 4: Output and freeing memory

header('Content-type: image/png');
imagepng($image);
imagedestroy($image);

here we are displaying the output and freeing the memory that has been held during the operation.

Results

Images that have been used:

Other similar Posts

How to Control a Linear Actuator with Arduino

Develop free Android Apps without coding in Nepal

watermark imagewatermark logo

Output Generated:

watermark output

Source Code

Share1TweetShareScan
Previous Post

Test Internet Speed using Python

Next Post

Fix for “Sorry, another account from your organization is already signed in on this computer.”

Also check out other Similar posts

CPU utilization in Windows 11
Computing

6 things you can do to speed up your Windows 11 computer

April 14, 2022
Speedup your Windows 11 Computer
How To

Speed up your Windows 11 computer by reducing startup time, here is how to

December 23, 2021
Reduce background noise during Microsoft Teams or Zoom meetings
How To

How to reduce background noise during Microsoft Teams or Zoom meetings

May 20, 2021
Speed up pc
How To

6 simple yet effect ways to speed up your Windows 10 computer

April 14, 2022
Permanently Remove LeadBoxer from Outlook
How To

Remove add-in services from Outlook, LeadBoxer as an example

January 29, 2021
Top 12 Microsoft Teams Keyboard shortcuts
Tips & Tricks

12 productivity keyboard shortcuts for Microsoft Teams

December 29, 2020
Next Post
fix for “Sorry, another account from your organization is already signed in on this computer.”

Fix for “Sorry, another account from your organization is already signed in on this computer.”

No Result
View All Result

Recent Posts

  • Apply now for the $25,000 UNESCO Prize for Your Education Technology Solution
  • Daraz announces the biggest sale of the year – Up to 80% off, mega vouchers up to 11,111 & more
  • 6 things you can do to speed up your Windows 11 computer
  • Vivo Launches V23 5G Smartphone with 50MP AF Portrait Selfie Camera and Elegant Color-Changing Exterior
  • Fix for slow or not responding Brave browser in Windows 11 #BraveBrowser #Windows11
  • Speed up your Windows 11 computer by reducing startup time, here is how to
  • What is band steering and why you should use it #WiFi #Networking
  • Messages for Android and Web saves you tonnes of time and features!
  • Great! Nagarik App now supports Vehicle Tax and Bluebook Info #NagarikApp
  • 👍 Nepal moves 15 spots up in Global Cybersecurity Index 2021

Recent Comments

  • onlinenepali on Top Websites in Nepal
  • Hikmat Bahadur Sunuwar on Micromax Service Center & Authorized Dealers in Nepal
  • Lorine on Top Websites in Nepal
  • shailendra on Top Websites in Nepal
  • Gloria Brooks on Daraz announces the biggest sale of the year – Up to 80% off, mega vouchers up to 11,111 & more

Listen to TechSansar Podcast

Categories

RoboForm: Learn more...

Recent Posts

  • Apply now for the $25,000 UNESCO Prize for Your Education Technology Solution January 3, 2023
  • Daraz announces the biggest sale of the year – Up to 80% off, mega vouchers up to 11,111 & more November 12, 2022
  • 6 things you can do to speed up your Windows 11 computer April 14, 2022
  • Vivo Launches V23 5G Smartphone with 50MP AF Portrait Selfie Camera and Elegant Color-Changing Exterior April 11, 2022
  • Fix for slow or not responding Brave browser in Windows 11 #BraveBrowser #Windows11 January 5, 2022
  • Speed up your Windows 11 computer by reducing startup time, here is how to December 23, 2021
  • What is band steering and why you should use it #WiFi #Networking November 25, 2021
  • Messages for Android and Web saves you tonnes of time and features! July 7, 2021
  • Great! Nagarik App now supports Vehicle Tax and Bluebook Info #NagarikApp July 5, 2021
  • 👍 Nepal moves 15 spots up in Global Cybersecurity Index 2021 July 1, 2021

Latest Questions

  • Wifi doesn’t turn back automatically Windows 10 asked by Chandani, 2 years ago
  • Your feed file is too big – Facebook Instant Articles asked by , 2 years ago
  • What is businessfocus.info ads? asked by , 2 years ago
  • MSDOS Boot creation problem. asked by , 3 years ago
  • Why does Google Site Kit keeps disconnecting? asked by Editor, 3 years ago
  • Best eBanking in Nepal asked by Editor, 4 years ago
  • Traditional Nepali Font asked by Malvika Shrestha, 4 years ago
  • Cloud servers VPS in Nepal asked by Sunita, 4 years ago
  • Cloud servers VPS in Nepal asked by Sunita, 4 years ago
  • Cloud servers VPS in Nepal asked by Sunita, 4 years ago

Categories

  • ADSL
  • Apple
  • Applications
  • Broadband
  • Broadcasting
  • Cell Phones
  • Cloud Computing
  • Computing
  • Default
  • Featured
  • Gadgets
  • Google
  • How To
  • India Inc
  • Internetworking
  • Microsoft
  • Nepali IT
  • New Release
  • Products
  • SMS & related
  • Social Networking
  • Software
  • Startups
  • Support
  • Tech Fun
  • Tech News
  • Technology
  • Technology in Effect
  • Telecom
  • Tips & Tricks
  • Tutorials
  • Uncategorized
  • Videos
  • Websites
  • Windows
  • Windows-7
  • टिप्सहरु
  • नेपाली टेक संसार
  • QnA Platform
  • Gadgets
  • Tech News
  • Tips & Tricks
  • About us
  • ICT in Nepal
  • Market

TechSansar.com, ICT For Media Pvt Ltd, Regd #249079/077/078, VAT #609868175. 
By continuing to use this site, you agree to our cookies and privacy policies.
Here is our Do Not Track (DNT) Guide. Hosted on a VPS in Singapore and uses this beautiful WordPress theme. You can also subscribe to our newsletter.
Creating tech contents for the b̶o̶t̶s̶ humans since 2009 • Team TechSansar • ICT4M with ❤ from Nepal

No Result
View All Result
  • Startups
  • Tech Events
    • Submit Tech Events in Nepal
  • Services
    • Shop
    • Web hosting Features
    • Projects initiated by Team TechSansar
    • Windows Apps developed by Team TechSansar
  • Top Posts
    • ICT Organizations in Nepal
    • Top Websites in Nepal
    • Trending Topics related to Nepal
    • Wi-Fi Access Directory Nepal
    • SEO Guide to Nepalese Bloggers – नेपाली ब्लगरहरुलाई SEO सम्बन्धि सुझावहरु
  • Market
    • LG TV Prices
    • Galaxy Tablet Prices
    • Samsung TV Prices
  • Categories
    • Gadgets
    • Nepali IT
    • Telecom
    • Freebies
  • QnA
    • Ask a Question
  • नेपाली संस्करण

TechSansar.com, ICT For Media Pvt Ltd, Regd #249079/077/078, VAT #609868175. 
By continuing to use this site, you agree to our cookies and privacy policies.
Here is our Do Not Track (DNT) Guide. Hosted on a VPS in Singapore and uses this beautiful WordPress theme. You can also subscribe to our newsletter.
Creating tech contents for the b̶o̶t̶s̶ humans since 2009 • Team TechSansar • ICT4M with ❤ from Nepal

Welcome Back!

Sign In with Facebook
Sign In with Google
OR

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

We are running on limited supplies. Kindly, chat with us before sending payments. Dismiss