Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • PHP Tutorial
  • PHP Exercises
  • PHP Array
  • PHP String
  • PHP Calendar
  • PHP Filesystem
  • PHP Math
  • PHP Programs
  • PHP Array Programs
  • PHP String Programs
  • PHP Interview Questions
  • PHP GMP
  • PHP IntlChar
  • PHP Image Processing
  • PHP DsSet
  • PHP DsMap
  • PHP Formatter
  • Web Technology
Open In App
Next Article:
PHP | Imagick clear() Function
Next article icon

PHP | Imagick destroy() Function

Last Updated : 31 Oct, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report

The Imagick::destroy() function is an inbuilt function in PHP which is used to destroy the Imagick object and free all the resources associated with it. You can’t access your object content once it is destroyed.

Syntax:

bool Imagick::destroy( void )

Parameters: This function does not accept any parameters.

Return Value: This function returns TRUE on success.

Below program illustrates the Imagick::destroy() function in PHP:

Program:




<?php
  
// Create a new imagick object with image
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png');
  
// Use your $imagick object for whatever you want 
// to do here and destroy it after using it.
  
// Destroying that object
$imagick->destroy();
?>
 
 

Output: Since image distroyed so it will not display any image.

Reference: https://www.php.net/manual/en/imagick.destroy.php



Next Article
PHP | Imagick clear() Function
author
gurrrung
Improve
Article Tags :
  • PHP
  • Web Technologies
  • PHP-function
  • PHP-Imagick

Similar Reads

  • PHP | Gmagick destroy() Function
    The Gmagick::destroy() function is an inbuilt function in PHP which is used to destroy the Gmagick object and frees all resources associated with it. Syntax: bool Gmagick::destroy( void ) Parameters: This function doesn’t accept any parameter. Return Value: This function returns TRUE on success. Exc
    1 min read
  • PHP | ImagickDraw destroy() Function
    The ImagickDraw::destroy() function is an inbuilt function in PHP which is used to free all resources associated with the ImagickDraw object. Syntax: bool ImagickDraw::destroy( void ) Parameters: This function doesn’t accepts any parameter. Return Value: This function returns TRUE on success. Except
    1 min read
  • PHP | Imagick clear() Function
    The Imagick::clear() function is an inbuilt function in PHP which is used to clear all resource allocated to an Imagick object. Syntax: bool Imagick::clear( void ) Parameters: This function does not accept any parameter. It just clears off the resources of the Imagick object which is used to call th
    2 min read
  • PHP | Imagick filter() Function
    The Imagick::filter() function is an inbuilt function in PHP which is used to apply custom convolution kernel to the image. A kernel, convolution matrix, or mask is a small matrix. It is used for blur, sharpen, embossing, edge detection, and many more. Syntax: bool Imagick::filter( $ImagickKernel, $
    1 min read
  • PHP | Imagick __construct() Function
    The Imagick::__construct() function is an Imagick class constructor which takes the image path or image URL as parameter to instantiate the Imagick object for a specific image or a set of images. Syntax: Imagick::__construct( $files ) Parameters: This function accepts single parameter $files which h
    1 min read
  • PHP | Imagick current() Function
    The Imagick::current() function is an inbuilt function in PHP which is used to return the reference of current Imagick object. This function does not create any copy but returns the same instance of Imagick. Syntax: Imagick Imagick::current( void ) Parameters: This function does not accepts any para
    2 min read
  • PHP | Imagick distortImage() Function
    The Imagick::distortImage() function is an inbuilt function in PHP which is used to distorts an image using various distortion methods. Syntax: bool Imagick::distortImage( $method, $arguments, $bestfit ) Parameter: This function accepts three parameters as mentioned above and described below: $metho
    1 min read
  • PHP | Imagick addImage() Function
    The Imagick::addImage() function is an inbuilt function in PHP which is used to adds new image to Imagick object image list. After the operation iterator position is moved at the end of the list. This function adds new image to Imagick object from the current position of the source object. The Imagi
    1 min read
  • PHP | Imagick clone() Function
    The Imagick::clone() function is an inbuilt function in PHP which is used to create a copy of Imagick object. This function creates copy of the same instance, that means it will have same properties and any change in it will not reflect to the main object. Syntax: Imagick Imagick::clone( void ) Para
    1 min read
  • PHP | Gmagick clear() Function
    The Gmagick::clear() function is an inbuilt function in PHP which is used to clear all resources associated to Gmagick object. Syntax: Gmagick Gmagick::clear( void )   Parameters: This function does not accepts any parameter. Return Value: This function returns the cleared Gmagick object. Errors/Exc
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences