Higher-level PHP constructs for manipulating image files.

Slides:



Advertisements
Similar presentations
PHP Sample Application Simple graphics and database.
Advertisements

Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Introduction to Programming
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
Drawing Objects with Illustrator 1.Start a new image in RGB mode. 2.Size 1024 X Unit = pixels 4.Go to View > Show Grid to turn on the grid. 5.Go.
Higher-level PHP constructs for manipulating image files (contd.)
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
CSC 160 Computer Programming for Non-Majors Lecture #3c: Working with Pictures (continued) Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Section 1.2: Drawing a UFO Prof. Adam M. Wittenstein
Editing Process Of Front Cover Lauren Alger I have shown screen shots of how I have put together all four of my pages for my final music magazine product.
Color Correct and Remove Keystoning A minimalist approach to photographing your art By Paul Marley.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
Tkinter Canvas.
1 Using layers NOTES. 2 Open Adobe Photoshop Elements. Select a size of A4. Create 5 new layers by selecting layer > new. Do this action five times. Click.
1 Using layers NOTES. 2 Open Adobe Photoshop Elements. Select a size of A4. Create 5 new layers by selecting layer > new. Do this action five times. Click.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
1 Printing & Imaging Technology Working with Layers Copyright © Texas Education Agency, All rights reserved. Images and other multimedia content.
Paint Tutorial Created February 2006 Start Paint: Start>Programs>Accessories>Paint.
+ This step by step tutorial demonstrates drawing a keyboard illustration using rectangles, grids, move and transform effects.
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
How many …?. What shape can you see? I can see some _____. Q1 Q1 stars.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
The Basics. Starting out This is the icon for Photoshop. Make sure that you have it!
PROCESSING A computer screen is a grid of small light elements called pixels.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
GD Library in PHP CH. Pradeep Reddy Assistant Professor VIT University, Vellore.
Adobe Photoshop CS5.
Girls On The Run Los Angeles
Levels of Organization Ecology Flow
PHP Image Manipulation
The Dharma as a Tool for for modern navigation
Developing Effective Project Management Strategy For Flood Disaster Prevention Projects in Bayelsa State Capital, Nigeria. Half-circle picture with accent.
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Gimp Guide Mr Hall.
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
First text statement positioned here at guide intersection
Atlas of World Diseases and Medical Conditions
Basic Graphics Drawing Shapes 1.
Physics Careers February1st, 2017
Smart Graphic Layout TOPIC statement
به نام مهربانترین In the name of the most compassionate
Animated picture changes during motion path (Advanced)
Project title Scheduled dates Team members JAN FEB MAR APR MAY JUN
TermiGator Ebrahem Hamdan University of Florida
بسم الله الرحمن الرحیم مركز بهمن استاندارد- مديريت ارزيابي و مانيتورينگ كيفي.
Click to play with audio
Farming: An example of a system
x IMPORTANT: read before building your presentation:
Economist Report (Advanced)
Building Java Programs
TAB ONE TAB TWO TAB THREE TAB FOUR TAB FIVE
What do you wonder about? “Find your passion and begin your journey.”
You’re a Junior! (Basic) Animated 3-D cube with changing pictures
Levels of Organization Ecology Flow
Animated picture collection: left picture moves to front center
TEXT TEXT TEXT Animated rectangles curve up and grow in sequence
موضوع بحث: تعریف علم اصول جلسه 43.
Pictures in 3-D flip book (Intermediate)
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
对 话 无 界 限 “对话是两个集合出现交集的一个刹那。” “对话是发现共同点的捷径。”.
Smart Graphic Layout TOPIC statement
The Wright Brothers Vocabulary (Basic)
قاعده لا ضرر، تنها در شبهات حکمیه جاری است
Please Do Now / Dec. 2, 15 Log into computer Go to
Defining Religious Experiences
TITLE BYOT Half Circle (Advanced)
Presentation transcript:

Higher-level PHP constructs for manipulating image files

A library of tools for manipulating images We have seen that we can create an image file by writing a sequence of bytes to the file But this is very tedious PHP provides a library of tools (functions) for creating and/or editing image files This library is called the GD library GD was actually written in C but "wrappers" are available for PHP, Perl and other languages The GD website

A first example program This program uses two tools from the GD library imageCreateTrueColor takes two arguments and produces a variable containing basic data for an image –the arguments specify the width and height of the image –By default, the image created by imageCreateTrueColor has a black background imageGIF takes two arguments –the data for an image and the name of a file –imageGIF puts a copy of the image data into a file with the specified name

Drawing a solid rectangle imagecolorallocate is used to add a colour to the palette that will be used in the image it takes four arguments: the image variable and the RGB values it returns an identifier for the specified colour imagefilledrectangle is used to place a solid rectangle of colour in the image it takes six arguments: the image variable, four coordinates for the rectangle and the identifier for the desired colour –the coordinates are X ul, Y ul, X lr, Y lr (ul=upper-left corner; lr=lower right corner)

Drawing two rectangles We can use imagecolorallocate several times, to add a range of colours We can use imagefilledrectangle several times, to add several solid rectangles

The sequence determines the result Above, we drew the blue rectangle last, so it appears on top of the others

Flood fill Use imagefill to flood fill the pixels around a specified coordinate The program above makes the image go through four steps, as shown Since (50,50) is in the middle of the red area, that rectangle is flooded with white

Drawing solid ellipses and circles imagefilledellipse ( $image, $cx, $cy, $width, $height, $colour ) $cx and $cy specify the centre of the shape $width and $height specify the width and height of the shape $width=$height produces a circle

Drawing polygons imagefilledpolygon ( $image, $arrayOfPoints, $numberOfPoints, $colour ) $arrayOfPoints specifies the X and Y coordinates of the vertices of the polygon $numberOfPoints specifies how many vertices –there must be at least three vertices An example is on the next slide

Drawing a triangle The vertices of the triangle are (40,50) (150,100) (40,70) Members of an array are specified like this: $result=array(val1, val2, val3,... );