Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Saving JPEG image

Saving JPEG image

Scheduled Pinned Locked Moved C#
csharp
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GauravKP
    wrote on last edited by
    #1

    I want to save jpg image 100 X 150 size in color format of 256color to reduce its size .......... suggest me any c# function

    A B 2 Replies Last reply
    0
    • G GauravKP

      I want to save jpg image 100 X 150 size in color format of 256color to reduce its size .......... suggest me any c# function

      A Offline
      A Offline
      Adam R Harris
      wrote on last edited by
      #2

      Look Here[^] Next time at least try this[^]. P.S it's the 7th link

      1 Reply Last reply
      0
      • G GauravKP

        I want to save jpg image 100 X 150 size in color format of 256color to reduce its size .......... suggest me any c# function

        B Offline
        B Offline
        benjymous
        wrote on last edited by
        #3

        btw, there's no such thing as a 256 color jpeg

        Help me! I'm turning into a grapefruit! Buzzwords!

        A 2 Replies Last reply
        0
        • B benjymous

          btw, there's no such thing as a 256 color jpeg

          Help me! I'm turning into a grapefruit! Buzzwords!

          A Offline
          A Offline
          Abdul Rahman Hamidy
          wrote on last edited by
          #4

          this can help you

          Image img=new Bitmap("filepath.jpg");
          Bitmap bmp=null;
          for(int i=0;i<img.Width;i++)
          {
          for(int j=0;j<img.Height;j++)
          {
          Color col=img.GetPixel(i,j);
          int avg=((col.R+col.G+col.B)/3);
          img.SetPixel(i,j,Color.FromArgb(avg,avg,avg));
          }
          }
          MemoryStream mem=new MemoryStream();
          img.Save(mem,ImageFormat.Gif);
          bmp=new Bitmap(mem);
          this.pictureBox1.Image=bmp;

          Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan

          B 1 Reply Last reply
          0
          • A Abdul Rahman Hamidy

            this can help you

            Image img=new Bitmap("filepath.jpg");
            Bitmap bmp=null;
            for(int i=0;i<img.Width;i++)
            {
            for(int j=0;j<img.Height;j++)
            {
            Color col=img.GetPixel(i,j);
            int avg=((col.R+col.G+col.B)/3);
            img.SetPixel(i,j,Color.FromArgb(avg,avg,avg));
            }
            }
            MemoryStream mem=new MemoryStream();
            img.Save(mem,ImageFormat.Gif);
            bmp=new Bitmap(mem);
            this.pictureBox1.Image=bmp;

            Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan

            B Offline
            B Offline
            benjymous
            wrote on last edited by
            #5

            Very nice, but that still doesn't make a 256 colour jpg (from what I can tell, it'd make a greyscale gif), which isn't what the OP wanted

            Help me! I'm turning into a grapefruit! Buzzwords!

            A 1 Reply Last reply
            0
            • B benjymous

              Very nice, but that still doesn't make a 256 colour jpg (from what I can tell, it'd make a greyscale gif), which isn't what the OP wanted

              Help me! I'm turning into a grapefruit! Buzzwords!

              A Offline
              A Offline
              Abdul Rahman Hamidy
              wrote on last edited by
              #6

              i know i only mentioned, that can help :)

              Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan

              1 Reply Last reply
              0
              • B benjymous

                btw, there's no such thing as a 256 color jpeg

                Help me! I'm turning into a grapefruit! Buzzwords!

                A Offline
                A Offline
                Abdul Rahman Hamidy
                wrote on last edited by
                #7

                this can possible help you.http://www.geekpedia.com/tutorial232_Reducing-JPEG-Picture-Quality-using-Csharp.html[^]

                Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups