{"id":54788,"date":"2020-01-04T00:00:00","date_gmt":"2020-01-03T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/jpeg-algoritm-szhatiya"},"modified":"2020-02-18T14:02:50","modified_gmt":"2020-02-18T11:02:50","slug":"jpeg-algoritm-szhatiya","status":"publish","type":"post","link":"https:\/\/prohoster.info\/no\/blog\/administrirovanie\/jpeg-algoritm-szhatiya","title":{"rendered":"JPEG. Komprimeringsalgoritme","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Hei igjen! Eg fann denne artikkelen, skrive i mai 2019. Dette er eit vidaref\u00f8ring av serien med artiklar om WAVE og JPEG. Her er <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/450774\/\">f\u00f8rste<\/a><\/noindex>. Denne publikasjonen vil inkludere informasjon om bildekomprimeringsalgoritmen og om formatet som helhet.<\/p>\n<p><\/p>\n<h3 id=\"schepotku-istorii\">Ein klype historie<\/h3>\n<p><\/p>\n<p>Ein spiseskei informasjon fr\u00e5 Wikipedia:<\/p>\n<p><\/p>\n<blockquote><p>JPEG (Joint Photographic Experts Group) er eit av dei popul\u00e6re rastergrafikkformat som blir brukt for \u00e5 lagre foto og liknande bilete.<\/p><\/blockquote>\n<p>Denne standarden vart utvikla av den internasjonale ferdighetsgruppa for fotografering allereie i 1991 for effektiv komprimering av bilete.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h3 id=\"kakoy-put-prohodyat-izobrazheniya-ot-syrogo-vida-do-jpeg\">Kva veg g\u00e5r bilete fr\u00e5 r\u00e5tt format til JPEG<\/h3>\n<p><\/p>\n<p>Nokre trur at JPEG-bilde er r\u00e5data komprimerte ved hjelp av Huffman-koding, men det er ikkje sant. F\u00f8r den endelige komprimeringa, g\u00e5r data gjennom ein lang prosess.<\/p>\n<p><\/p>\n<p>F\u00f8rst blir fargemodellen endra fr\u00e5 RGB til YCbCr. For dette finst det til og med ein spesiell algoritme \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/ru.wikipedia.org\/wiki\/YCbCr#%D0%9F%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F_%D0%BF%D0%BE_%D1%80%D0%B5%D0%BA%D0%BE%D0%BC%D0%B5%D0%BD%D0%B4%D0%B0%D1%86%D0%B8%D0%B8_ITU-R_BT.601\">her<\/a><\/noindex>. Y blir ikkje endra, sidan det er ansvarleg for lysstyrken, og ei endring her ville vere merkbar.<\/p>\n<p><\/p>\n<p>Det f\u00f8rste som blir gjort med bildet, er <strong>\u00abpruning\u00bb<\/strong> (subsampling). Det er enkelt \u00e5 forst\u00e5: ein 2x2 matrise med pikslar blir brukt, og ein tek s\u00e5 Cb og Cr \u2014 gjennomsnittet av kvar av komponentane YCbCr for desse 4 pikslane. Slik, <em>har vi spart 6 byte<\/em>, instead of 4 Y, 4 Cb, 4 Cr we received 4 Y and the same Cb and Cr for each of them (4 + 4 + 4 = 12; 4 + 1 + 1 = 6; 12 \u2014 6 = 6). Even at 2\u00d72 scale, lossy compression with a compression ratio of 2:1 sounds solid. This applies to the entire image. And so \u2014 we reduced the size by half. We can use this technique thanks to our color perception. A person easily notices differences in brightness, but not in color when averaged in a small block of pixels. Pruning can also be done in a line, 4 pixels horizontally and vertically. The first option is used more often. If image quality is important, then pruning is not done at all.<br \/>\nEin illustrativ framstilling av underpr\u00f8ving (Habr till\u00e9t ikkje at eg sette inn gif) \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/i.ibb.co\/Rg5Th9H\/150953010617579181.gif\">https:\/\/i.ibb.co\/Rg5Th9H\/150953010617579181.gif<\/a><\/noindex><\/p>\n<p><\/p>\n<h5 id=\"osnovnaya-chast-podgotovki\">Hovuddelen av tilberedelsen<\/h5>\n<p>\nDCT<\/p>\n<p>Now the most complex and necessary part. The entire image is divided into 8\u00d78 blocks (padding is used if the resolution is not a multiple of the block size).<\/p>\n<p><\/p>\n<p>No blir DCT (Diskret kosinus-transformasjon) brukt p\u00e5 kvar blokk. <strong>DCT (Diskret kosinus-transformasjon)<\/strong>. In this part, everything unnecessary is removed from the image. Using DCT, you need to determine whether this block (8\u00d78) describes any monotonic part of the image: sky, wall; or if it contains a complex structure (hair, symbols, etc.). Logically, 64 similarly colored pixels can be described by just 1, as the block size is already known. Here you have the compression: 64 to 1.<\/p>\n<p><\/p>\n<p>DCT omdanner blokken til et spektrum, og der hvor m\u00e5lingene skifter br\u00e5tt, blir koeffisienten positiv, og jo skarpere overgangen er, desto h\u00f8yere blir utgangen. Der hvor koeffisienten er h\u00f8yere, vises klare overganger i farge og lysstyrke, hvor den er lavere \u2014 svake (jevn) endringer i komponentene YCbCr i blokken.<\/p>\n<p>\nKvantisering<\/p>\n<p>Here, the compression settings are applied. Each coefficient in each of the 8\u00d78 matrices is divided by a certain number. If you will not reduce the image quality after all its modifications, the divisor should be one. If the memory occupied by this photograph is more important to you, then the divisor will be greater than 1, and the quotient is rounded. Thus, it often turns out that many zeros result after rounding.<\/p>\n<p><\/p>\n<p>Kvantisering gj\u00f8res for \u00e5 lage mulighet for enda st\u00f8rre kompresjon. Slik ser det ut i eksemplet med kvantisering av grafen y = sin(x):<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"JPEG. Komprimeringsalgoritme\" src=\"\/wp-content\/uploads\/2020\/01\/ab6c205c62133785b19b5f42db109fa6.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p>\nKompresjon<\/p>\n<p>F\u00f8rst g\u00e5r vi gjennom matrisen i en sikksakk:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"JPEG. Komprimeringsalgoritme\" src=\"\/wp-content\/uploads\/2020\/01\/576a5e65431d38742efe42ead0e3863b.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Vi f\u00e5r et en-dimensjonalt array med tall. Vi ser at det er mange nuller i det, som kan fjernes. I stedet for sekvenser av mange nuller skriver vi inn 1 null og etter det et tall som angir mengden i sekvensen. P\u00e5 denne m\u00e5ten kan vi redusere st\u00f8rrelsen til hele arrayet til 1\/3. S\u00e5 blir dette arrayet enkelt komprimert ved hjelp av Huffman-metoden, og deretter skrives det inn i selve filen.<\/p>\n<p><\/p>\n<h3 id=\"gde-ispolzuetsya\">Hvor brukes<\/h3>\n<p><\/p>\n<p>Everywhere. Like PNG, JPEG is used in cameras, OS\u2019s (as company logos, application icons, thumbnails) and in all possible areas where it is necessary to store images efficiently.<\/p>\n<p><\/p>\n<h3 id=\"vyvod\">Utdata<\/h3>\n<p><\/p>\n<p>For \u00f8yeblikket er kunnskap om JPEG verdifullt for utdanningsform\u00e5l, da den allerede er innebygd overalt og optimalisert av store grupper mennesker, men vitenskapens granitt er fortsatt fristende.<\/p>\n<p>\nKilder<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/ru.wikipedia.org\/wiki\/YCbCr\">Artikkel om YCbCr p\u00e5 Wikipedia<\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/ru.wikipedia.org\/wiki\/JPEG\">Artikkel om JPEG p\u00e5 Wikipedia<\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/pikabu.ru\/story\/kak_ustroen_format_jpeg_5452388\">Litt om DCT fra et innlegg p\u00e5 Pikabu<\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B8%D1%81%D0%BA%D1%80%D0%B5%D1%82%D0%BD%D0%BE%D0%B5_%D0%BA%D0%BE%D1%81%D0%B8%D0%BD%D1%83%D1%81%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">Artikkel om DCT p\u00e5 Wikipedia<\/a><\/noindex><\/p>\n<p>Kilde: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/482728\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u042f \u043d\u0430\u0448\u0435\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0435\u0449\u0435 \u043c\u0430\u0435 2019-\u043e\u0433\u043e \u0433\u043e\u0434\u0430. \u042d\u0442\u043e \u2014 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e WAVE \u0438 JPEG, \u0412\u043e\u0442 \u043f\u0435\u0440\u0432\u0430\u044f. \u042d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u043e \u0441\u0430\u043c\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c. \u0429\u0435\u043f\u043e\u0442\u043a\u0443 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0421\u0442\u043e\u043b\u043e\u0432\u0443\u044e \u043b\u043e\u0436\u043a\u0443 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0437 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438: JPEG (Joint Photographic Experts Group) \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-54788","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.5 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0418 \u0441\u043d\u043e\u0432\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u042f \u043d\u0430\u0448\u0435\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0435\u0449\u0435 \u043c\u0430\u0435 2019-\u043e\u0433\u043e \u0433\u043e\u0434\u0430. \u042d\u0442\u043e \u2014 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e WAVE \u0438 JPEG, \u0412\u043e\u0442 \u043f\u0435\u0440\u0432\u0430\u044f.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/no\/blog\/administrirovanie\/jpeg-algoritm-szhatiya\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.5\" \/>\n\t\t<meta property=\"og:locale\" content=\"nn_NO\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47JPEG. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0436\u0430\u0442\u0438\u044f | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0418 \u0441\u043d\u043e\u0432\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u042f \u043d\u0430\u0448\u0435\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0435\u0449\u0435 \u043c\u0430\u0435 2019-\u043e\u0433\u043e \u0433\u043e\u0434\u0430. \u042d\u0442\u043e \u2014 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e WAVE \u0438 JPEG, \u0412\u043e\u0442 \u043f\u0435\u0440\u0432\u0430\u044f.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/no\/blog\/administrirovanie\/jpeg-algoritm-szhatiya\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-01-03T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:02:50+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47JPEG. Komprimeringsalgoritme | ProHoster","description":"Og igjen, hei! Jeg har funnet denne artikkelen, skrevet i mai 2019. Dette er en fortsettelse av artikkelserien om WAVE og JPEG. Her er den f\u00f8rste.","canonical_url":"https:\/\/prohoster.info\/no\/blog\/administrirovanie\/jpeg-algoritm-szhatiya","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"nn_NO","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47JPEG. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0436\u0430\u0442\u0438\u044f | ProHoster","og:description":"\u0418 \u0441\u043d\u043e\u0432\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u042f \u043d\u0430\u0448\u0435\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0435\u0449\u0435 \u043c\u0430\u0435 2019-\u043e\u0433\u043e \u0433\u043e\u0434\u0430. \u042d\u0442\u043e \u2014 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e WAVE \u0438 JPEG, \u0412\u043e\u0442 \u043f\u0435\u0440\u0432\u0430\u044f.","og:url":"https:\/\/prohoster.info\/no\/blog\/administrirovanie\/jpeg-algoritm-szhatiya","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-01-03T21:00:00+00:00","article:modified_time":"2020-02-18T11:02:50+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"54788","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-24 12:45:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 10:01:54","updated":"2026-01-24 12:45:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/posts\/54788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/comments?post=54788"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/posts\/54788\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/media?parent=54788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/categories?post=54788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/no\/wp-json\/wp\/v2\/tags?post=54788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}