• About us
  • Advertising
  • Send Press Release
  • ICT Indicators
Monday, March 8, 2021
  • Login
  • Register
TechSansar.com • Nepal Information and Technology Navigator Website from Nepal
  • Startups
  • Tech Events
    • Submit Tech Events in Nepal
  • Services
    • 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
  • नेपाली संस्करण
No Result
View All Result
TechSansar.com • Nepal Information and Technology Navigator Website from Nepal
  • Startups
  • Tech Events
    • Submit Tech Events in Nepal
  • Services
    • 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

4 months ago
in How To, Software, Tips & Tricks, Tutorials
Reading Time: 2min 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.

Loading...

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

Loading...

Source Code

Loading...
Tags: PHPProgramming
ShareTweetShareScan
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

Speed up pc
How To

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

February 5, 2021
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
Enable public Live Events aka Webinar in Microsoft Teams
How To

[How to] Enable public Live Events aka Webinar in Microsoft Teams #MSTeams #LiveEvents #Webinar

December 26, 2020
session vs token
Software

Session vs Token Authentication in Information Security

November 12, 2020
fix for “Sorry, another account from your organization is already signed in on this computer.”
Tutorials

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

November 12, 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.”

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Posts

  • Samsung’s Flagship Phones Prices in Nepal
  • 6 simple yet effect ways to speed up your Windows 10 computer
  • Mi Air Charging – Insane Revolution
  • Remove add-in services from Outlook, LeadBoxer as an example
  • Samsung Galaxy S21 Ultra vs iPhone 12 Pro Max – True Battle
  • Samsung Galaxy Buds Pro – Truly Adventurous
  • Galaxy S21 and S21+ 5G – Truly Dazzling
  • Samsung Galaxy S21 Ultra – New Flagship
  • Samsung Exynos 2100 the success
  • Elon Musk’s Tesla a success

Recent Comments

  • hhhhhh on Top Websites in Nepal
  • Krrish shrestha on Price of Samsung TVs Curved, QLED, SUHD, LCD, LED, 3D Smart and UHD TV in Nepal
  • Samsung's Flagship Phones Prices in Nepal • TechSansar.com on Samsung Galaxy S21 Ultra – New Flagship
  • Nawaraj Maskey on All Nepali Fonts – download & install in Windows, Mac & Ubuntu
  • Editor on WeChat finally legal in Nepal, WeChat Pay transactions now possible!

Listen to TechSansar Podcast

Categories

RoboForm: Learn more...

Popular Questions

  • Kantipur TV MPEG4 DVB-S2 Frequency
  • Kaymu to Daraz
  • Technical specifications of AP1 HD TV Nepal
  • Watch Nepali TV channels online live
  • Where can I find laptop price in Nepal?
  • Which is the most earning website in Nepal?
  • Cloud servers VPS in Nepal
  • Video resolution of Kantipur TV
  • Traditional Nepali Font
  • Cloud servers VPS in Nepal

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

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 • Uses this beautiful theme. You can also subscribe to our newsletter.Creating tech contents for the bots humans since 2009 Team TechSansar • NTRC With ❤ from Nepal

No Result
View All Result
  • Startups
  • Tech Events
    • Submit Tech Events in Nepal
  • Services
    • 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
  • नेपाली संस्करण

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 • Uses this beautiful theme. You can also subscribe to our newsletter.Creating tech contents for the bots humans since 2009 Team TechSansar • NTRC With ❤ from Nepal

Welcome Back!

Sign In with Facebook
Sign In with Google
OR

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Sign Up with Facebook
Sign Up with Google
OR

Fill the forms below to register

All fields are required. Log In

Retrieve your password

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

Log In

Add New Playlist