{"id":213,"date":"2020-02-11T11:19:19","date_gmt":"2020-02-11T11:19:19","guid":{"rendered":"http:\/\/learnlearn.uk\/alevelcs\/?page_id=213"},"modified":"2021-04-29T06:26:25","modified_gmt":"2021-04-29T06:26:25","slug":"vector-images","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/","title":{"rendered":"Vector Images"},"content":{"rendered":"<div class=\"responsive-tabs\">\n<h2 class=\"tabtitle\">Vector Images<\/h2>\n<div class=\"tabcontent\">\n\n<h3>What are vector images?<\/h3>\n<p>Whereas bitmap files represent image data using a grid of pixels combined to make a whole picture, vector files store imge data in a completely different manner. Vector files use mathematic formulas to store the details of components of an object (such as shape, size, colour, outline) that combine together to form the final image.<\/p>\n<p><strong>Advantages of vectors<\/strong><\/p>\n<ul>\n<li>Generally smaller files sizes than bitmaps<\/li>\n<li>Far more scalable than bitmap images (theoretically inifite)<\/li>\n<li>Great for logos, cartoons or other drawn items<\/li>\n<\/ul>\n<p><strong>Disadvantages of vectors<\/strong><\/p>\n<ul>\n<li>More difficult to learn how to create vector drawings and use vector drawing software<\/li>\n<li>Not appropriate for use when storing digital photos as the data is too complex.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">Vector Images in Python<\/h2>\n<div class=\"tabcontent\">\n\n<p>Vector Images using Python<\/p>\n<p>You can use the drawSvg package in Python to create your own Scaled Vector Graphics files in order to illustrate how vectors work (You&#8217;ll need to execute\u00a0<strong>pip3 install drawSvg<\/strong>\u00a0in the terminal\/CMD console to install the module first).<\/p>\n<p>Here is the Python code to draw a rectangle.<\/p>\n<pre>import drawSvg as draw\r\n\r\nd = draw.Drawing(200,100, origin='center', displayInline = False)\r\n\r\nd.append(draw.Rectangle(0,0,40,50, fill = '#ff00ff'))\r\n\r\nd.setPixelScale(4)\r\n\r\nd.saveSvg('test1.svg')<\/pre>\n<p><a href=\"https:\/\/pypi.org\/project\/drawSvg\/\">More examples of shapes and drawing techniques can be found here.\u00a0<\/a><\/p>\n<p><strong>Challenge<\/strong><\/p>\n<p>Can you write a Python Program that draws a picture of a house (and maybe some clouds in the sky) using drawSvg?<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">Resources<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Past Paper Questions<\/h3>\n<p><a href=\"https:\/\/pastpapers.papacambridge.com\/view.php?id=Cambridge%20International%20Examinations%20%28CIE%29\/AS%20and%20A%20Level\/Computer%20Science%20-%209608\/2018-Oct-Nov\/9608_w18_qp_12.pdf\">November 18 Paper 12 Qn 1C<\/a><\/p>\n<p>&nbsp;<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What are vector images? Whereas bitmap files represent image data using a grid of pixels combined to make a whole picture, vector files store imge data in a completely different manner. Vector files use mathematic formulas to store the details of components of an object (such as shape, size, colour, outline) that combine together to&hellip;&nbsp;<a href=\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Vector Images<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":70,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vector Images - A Level Computer Science<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vector Images - A Level Computer Science\" \/>\n<meta property=\"og:description\" content=\"What are vector images? Whereas bitmap files represent image data using a grid of pixels combined to make a whole picture, vector files store imge data in a completely different manner. Vector files use mathematic formulas to store the details of components of an object (such as shape, size, colour, outline) that combine together to&hellip;&nbsp;Read More &raquo;Vector Images\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/\" \/>\n<meta property=\"og:site_name\" content=\"A Level Computer Science\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-29T06:26:25+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/\",\"name\":\"Vector Images - A Level Computer Science\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#website\"},\"datePublished\":\"2020-02-11T11:19:19+00:00\",\"dateModified\":\"2021-04-29T06:26:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"A Level Computer Science Home\",\"item\":\"https:\/\/learnlearn.uk\/alevelcs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vector Images\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/\",\"name\":\"A Level Computer Science\",\"description\":\"CIE Specification\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/alevelcs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#organization\",\"name\":\"A Level Computer Science\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"A Level Computer Science\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vector Images - A Level Computer Science","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/","og_locale":"en_GB","og_type":"article","og_title":"Vector Images - A Level Computer Science","og_description":"What are vector images? Whereas bitmap files represent image data using a grid of pixels combined to make a whole picture, vector files store imge data in a completely different manner. Vector files use mathematic formulas to store the details of components of an object (such as shape, size, colour, outline) that combine together to&hellip;&nbsp;Read More &raquo;Vector Images","og_url":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/","og_site_name":"A Level Computer Science","article_modified_time":"2021-04-29T06:26:25+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/","url":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/","name":"Vector Images - A Level Computer Science","isPartOf":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/#website"},"datePublished":"2020-02-11T11:19:19+00:00","dateModified":"2021-04-29T06:26:25+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/alevelcs\/vector-images\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/alevelcs\/vector-images\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"A Level Computer Science Home","item":"https:\/\/learnlearn.uk\/alevelcs\/"},{"@type":"ListItem","position":2,"name":"Vector Images"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/alevelcs\/#website","url":"https:\/\/learnlearn.uk\/alevelcs\/","name":"A Level Computer Science","description":"CIE Specification","publisher":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/alevelcs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/alevelcs\/#organization","name":"A Level Computer Science","url":"https:\/\/learnlearn.uk\/alevelcs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"A Level Computer Science"},"image":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/alevelcs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"What are vector images? Whereas bitmap files represent image data using a grid of pixels combined to make a whole picture, vector files store imge data in a completely different manner. Vector files use mathematic formulas to store the details of components of an object (such as shape, size, colour, outline) that combine together to&hellip;&nbsp;Read&hellip;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages\/213"}],"collection":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":7,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages\/213\/revisions"}],"predecessor-version":[{"id":2128,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages\/213\/revisions\/2128"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/media?parent=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}