VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 33
Thread
  1. Anonymous543
    Guest
    hello guys!!
    i have made a program which is inside pixel.zip file



    download and extract this file and you will get folder named pixel
    inside that folder run pixel.exe which is made by me and it will display 3 100width x 100height RGB squares
    make sure you run this file without deleting any .dll files
    and also it will run in windows only


    So...my question is..
    does bmp png etc uncompressed image file formats stores data like this?
    read source code of my program..
    Last edited by Baldrick; 5th Jun 2022 at 12:10. Reason: Link removed
    Quote Quote  
  2. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    No. Neither I or anyone will download and run a file with a potentially virus loaded exe! Reported.
    Quote Quote  
  3. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Link removed.
    Quote Quote  
  4. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    TY!
    Quote Quote  
  5. Anonymous543
    Guest
    It doesn't contains any virus ,you would have check first with anti virus before removing link, it was just a small software which was made by my self ,even i have written the source code of that exe inside the zip file-_-
    Quote Quote  
  6. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    It does not matter. The file was un-solicited. Really, if you want to promote a program you must do this via the admim of the forum first.
    Quote Quote  
  7. Anonymous543
    Guest
    I didn't wanted to promote any files ,i just wanted to clear my doubts, i agree that i should i have asked to admins first before posting links ,but there should be an another rule for false reports.
    Quote Quote  
  8. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Here's the thing @kirito, and I think this has been pointed out to you before.:

    There are very few reasons to reinvent the wheel.
    You are trying to learn? Then learn, using appropriate, definitive, historically grounded reference material, guided by respected coaches & experts to keep you focused on the right path.

    You have a format that is novel and/or better than others? You build out a prototype that allows for objective comparison to those others. Doing so objectively requires other factors to be the same so that only the characteristics in question are evaluated in isolation. To do so with known formats requires that yours be structured to be compatible with existing players.
    Also, subsequent sharing of your format also means being compliant with standards.

    You gave us (well, me at least) the impression you were working on the 1st thesis. Then you post something mysterious that possibly is a proof of concept of your 2nd thesis. But you expect us to risk the security of our systems just because you don't want to follow (or have the patience to follow) the standards? Think again.

    Plus, you have never really stated what your end goal is, so there is no way to properly evaluate.


    Scott
    Quote Quote  
  9. Just post your source code.
    Quote Quote  
  10. Anonymous543
    Guest
    Source code =
    Code:
    	function love.draw()
    	love.graphics.setColor(1, 0, 0)  --sets color red 
    	love.graphics.rectangle("fill", 0,0, 100,100)    --draws square of red color 100x100 at cordinate x=0 y=0
    
    	love.graphics.setColor(0, 1, 0)  --sets color green
    	love.graphics.rectangle("fill", 0,100, 100,100)  --draws square of green color 100x100 at cordinate x=0 y=100(here y=100 so that it will display under red sqaure)
    
    	love.graphics.setColor(0, 0, 1)  --sets color blue
    	love.graphics.rectangle("fill", 0,200, 100,100)  --draws square of blue color 100x100 at cordinate x=0 y=200(here y=200 so that it will display under red sqaure and green sqaure)
    	
    end
    You have to copy paste this lines and make fille
    Name and extension main.lua

    And run it through love2d engine

    https://youtu.be/ZQCky-_Ad5Y

    Here is simple tutorial video on how to load files in love2d by drag and drop

    And you can download love2d engine from its official website ,it's file size is below 5mb



    I wanna know how bmp and png was created and in which language they store pixel data
    Quote Quote  
  11. Anonymous543
    Guest
    Am not interested to make games i just wanna know how bmp png and other image file format works using may be graphics or idk
    Quote Quote  
  12. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    You have already been given links to definitive documents.

    You understand that they are compressed or uncompressed versions of binary rectangular arrays, with structured color systems, sampling ratios, plane ordering, bit depths...
    There are, also, accompanying headers & metadata to facilitate ease of understanding & decoding by the decoder/player.

    If you are asking about bmp, look up the RIFF structure. PNG is a more open & modern standard, but both have been around long enough that there are no longer patents on their use, so the info should be readily available to someone who puts effort into the research.

    If you need to poke at the internals, you can always use a hex viewer.

    Scott
    Quote Quote  
  13. Anonymous543
    Guest
    Bmp ,png and other files needs decoders ,but the way i made that .exe doesn't need any decoder ,i guess it just directly draw /display color information from the source code..
    There's one disadvantage of is requires .dll files to run .exe and which i think is not a big disadvantage because .dll files does not take much space , if we compare this things with bmp and pngs then they also requires decoders and they also take space..
    Quote Quote  
  14. Anonymous543
    Guest
    If you read my source code then..in source code i have given instructions to draw 3 rectangles of same width height of 100×100 it's actually called a square but in love2d Syntex we have to write love.graphics.rectangle
    This 3 squares has 3 diffrent colours which is primary colors RGB and 3 squares has diffrent locations
    Quote Quote  
  15. Anonymous543
    Guest
    So i think images are nothing but just set of instructions which graphics process..
    Quote Quote  
  16. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    So your method does not generate an independent, portable, standards-compatible media file, but is basically a binary version of source code instructions, and your "player" (which is just a runtime interpreter) is just generating the image based on your instructions.

    Perhaps you should look up info on Vector graphics (e.g. Adobe illustrator, postscript), because that is exactly what that is doing.
    One thing you will find out soon enough is that Vector graphics are compact when dealing with clean, abstract, geometric images, but then balloon to unwieldy sizes (even well beyond bitmap graphics) when dealing with real-world images.

    Plus your method is only as good, versatile and as portable as your runtime. You say you don't want to do games, yet you're specifically using an API geared towards gaming...?

    Scott
    Last edited by Cornucopia; 5th Jun 2022 at 14:01.
    Quote Quote  
  17. Anonymous543
    Guest
    So your method does not generate an independent, standards-compatible media file
    Yess it will not work on all platforms like.. windows .exe files won't run in linux or mac directly..

    Butt if we have source code(image data) then we can compile it to any other platforms

    Vector graphics are compact when dealing with clean, abstract, geometric images
    I know lil bit about vector graphics in that we have to specify radius of circle or dimensions of square, rectangles etc not sure about it ,

    Vector graphics will not suited for real world images that i agree because of many complex details..
    But will it suit if we make short animation..like if i draw a character and make it little walk or talk(audio in sync)?

    You say you don't want to do games, yet you're specifically using an API geared towards gaming...?
    Well i wanted to make images in different way..not with Photoshop or paint ,and my computer specifications are too low so i just wanted an simple small API which deals with graphics that's why i chosed love2d ,
    Another reason is i tried to code in c/c++ but adding graphics in this kind of language is very complex and i didn't understand the process ,plus am not professional in programing
    Quote Quote  
  18. Maybe learn about existing bicycle types before inventing another one? You are at least 35 years behind.
    Quote Quote  
  19. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Fast - Cheap - Good.

    Sounds like you went with the 1st 2.


    Scott
    Quote Quote  
  20. I'd focused what is already useful for other things, like Python, C or java.
    I don't think Python is much more difficult than lua language and can catapult you to design other stuff, even for work if you are younger.

    https://realpython.com/pygame-a-primer/
    you can google some youtube pygame tutorial, or get other animating module for python, don't know, there might be more of them, better suited for your purpose

    And again, I'd use modules already written for creating images, for example within that pygame module it is:
    pygame.image.save(your_surface, 'xxxxx.BMP')

    or using opencv, you still did not describe what you want to do exactly
    Last edited by _Al_; 5th Jun 2022 at 16:22.
    Quote Quote  
  21. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by kirito View Post
    Well i wanted to make images in different way..not with Photoshop or paint ,and my computer specifications are too low...
    If Paint is too demanding for you computer, then your only choice is to go analog.

    Originally Posted by kirito View Post
    i just wanted an simple small API which deals with graphics...
    What means "deals with graphics", what do you want to do?
    Quote Quote  
  22. Originally Posted by kirito View Post
    Source code =
    Code:
    	function love.draw()
    	love.graphics.setColor(1, 0, 0)  --sets color red 
    	love.graphics.rectangle("fill", 0,0, 100,100)    --draws square of red color 100x100 at cordinate x=0 y=0
    
    	love.graphics.setColor(0, 1, 0)  --sets color green
    	love.graphics.rectangle("fill", 0,100, 100,100)  --draws square of green color 100x100 at cordinate x=0 y=100(here y=100 so that it will display under red sqaure)
    
    	love.graphics.setColor(0, 0, 1)  --sets color blue
    	love.graphics.rectangle("fill", 0,200, 100,100)  --draws square of blue color 100x100 at cordinate x=0 y=200(here y=200 so that it will display under red sqaure and green sqaure)
    	
    end
    You are using a high level graphics library. Everything is abstracted. That is done so you don't have to understand what's happening with pixels and other low level data structures. Exactly what you don't want if you're trying to understand graphics at the lowest levels. Since the library is drawing something on the screen in Windows it is at some level producing Windows Bitmap data. But whether you can save that data to a BMP file depends on whether or not it's made available to you. You'll have to read the library's docs. In all likelihood they provide functions for that.

    Basically, you know so little that you're asking questions that don't make any sense. Do yourself a favor an go buy yourself a book like Computer Graphics Principles and Practice by Foley/VanDam. Learn the basics.
    https://www.amazon.com/Computer-Graphics-Principles-Practice-2nd/dp/0201848406/
    Last edited by jagabo; 5th Jun 2022 at 20:16.
    Quote Quote  
  23. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by kirito View Post
    So i think images are nothing but just set of instructions which graphics process..
    No, "images" (if you refer to graphic formats such as bmp, png, jpg..) are NOT set of instructions.

    You seem a bit confused: the creation of an image through programming and some "instructions" (as in your love2d example) is a totally different thing from images stored in raster file formats (the ones you mentioned in the title). The most similar thing to an image built through programming - even NOT the same thing - are vector file formats (such as svg) , as they are completely different from raster graphic file formats.

    In a raster graphic file format (such as bmp, png, jpg ) images are simply chunks of data organized in some very specific way (different for each format) that then the software "decodes" to represent the image itself, but those data are (for the most part) only information about the color of each pixel - plus some additional information, such the header and tags - absolutely not instruction as in some kind of code in a program.
    Last edited by krykmoon; 5th Jun 2022 at 18:54.
    Quote Quote  
  24. Anonymous543
    Guest
    @_Al_
    I'd focused what is already useful for other things, like Python, C or java.
    I don't think Python is much more difficult than lua language and can catapult you to design other stuff, even for work if you are younger.
    i chosed lua because its usefull for scripting in android
    we can run some lua scripts with gameguardian.apk to cheat small games and level up..
    gameguardian.apk is just like cheatengine of android

    @_Al_
    And again, I'd use modules already written for creating images, for example within that pygame module it is:
    pygame.image.save(your_surface, 'xxxxx.BMP')
    love2d engine also has some modules like this
    example code
    Code:
        function love.load()
        whale = love.graphics.newImage("whale.png")
        end
        function love.draw()
        love.graphics.draw(whale, 300, 200)
        end
    this will draw any png file with using love2d

    @_Al_
    or using opencv,
    i tried to use opencv with c/c++ but it requires so many things like..first need to setup IDE then compiler and then configure graphics.h file and etc etc..

    @_Al_
    you still did not describe what you want to do exactly
    i am just intrested to know more about image file formats,



    @VoodooFX
    If Paint is too demanding for you computer, then your only choice is to go analog.
    paint is not demanding ,i just wanna draw some images without using modern image formats like png and bmp
    and also that should be lossless!!

    @VoodooFX
    What means "deals with graphics", what do you want to do?
    means give commands to graphics and display something which looks like image




    Image
    [Attachment 65228 - Click to enlarge]

    This screenshot for those who did not watched my program..
    pixel.exe is displaying 3 RGB(we can create any color by mixing) square of 100x100 without any quality loss i guess..


    does PNG and BMP stores data like the way i did?
    like this
    graphics.Color.informationofpixel1(red)
    graphics.pixel1(x,y cordinates)

    graphics.Color.informationofpixel2(green)
    graphics.pixel2(x,y cordinates)

    graphics.Color.informationofpixel3(blue)
    graphics.pixel3(x,y cordinates)
    Quote Quote  
  25. Originally Posted by kirito View Post
    paint is not demanding ,i just wanna draw some images without using modern image formats like png and bmp
    and also that should be lossless!!
    BMP is almost forty years old. PNG is slightly younger, about a quarter century.
    Quote Quote  
  26. i am just intrested to know more about image file formats,
    How they are engineered? That you can find on wiki, but you should not be concerned about that at this moment, but you do not realize that. Each system, library, module you are going to use does it for you. Saves it into that format if needed, because internally within app it works differently. Those BMP and PNG are stored as a bitmap, where every pixel has a defined value for R,G,B and alpha (or YUV set etc). But how your app works, is app dependent or module dependent. It is about how those data is written in memory, to access them fast again and change them, possibly as quickly as possible and en masse! So when your app loads a BMP image or creates an image, what happens is, it effectively stores it in your memory . Imagine your code has many many lines drawing circles , rectangles. Where processing first line (example drawing a circle), needs to be stored somewhere before second line is processed, drawing is made again on top of it, etc. and that storing order/format in your memory is not the same as your loaded BMP was stored.. That could differ from app to app.
    does PNG and BMP stores data like the way i did?
    like this
    graphics.Color.informationofpixel1(red)
    graphics.pixel1(x,y cordinates)

    graphics.Color.informationofpixel2(green)
    graphics.pixel2(x,y cordinates)

    graphics.Color.informationofpixel3(blue)
    graphics.pixel3(x,y cordinates)
    No, after loading a BMP image, data is stored in memory depending how you app works, it is stored as bitmap of some sort but sort of reorganized. Data could be packed (every pixel data for R,G,B and Alpha are next to each other) or planar (R values are next to each other, G value are next to each other,...) or whatever sort of arrays in memory (stored with start of data, size , dimension, bitdepth, like numpy arrays) and to store it effectively for fast memory access. Or if you make up an app you can made that up yourself how data is stored in memory and accessed thru pointers ( memory address where data starts, I guess C only). Within your app you could store data as a set of instructions (but not by a code as you posted, it would be again bunch of data with rules) but if you draw something on the top of something for a preview you'd need to draw a bitmap anyway to get it on screen. For a preview you need a bitmap. Certainly you cannot store data for a BMP as a set of instructions or rules. Instead, it is used a thing called compression (using a codec). You can save then a lossless (PNG), or lossy (JPG). Or of course as a raw form (BMP). Unlikely you'd compress within your app between drawings. Anyway, perhaps unless using C, there is modules, libraries, that take care of of storing and rewriting data in a dimension most effectively and guys developing that dedicate half of their lives (or teams) to design it. You have no chance to come up with anything faster or introduce a new standard. You posted some DLL's, that's what it is most likely, some libraries to get graphics. Set of your instructions to make a bitmap from your code or rather data that your app created in your memory. If your image data is some sort of set of instructions, that can be loaded only in your app or with some interpreter to bitmap, planar memory, array ... That is quite common (but not to store images) and it is called project file. After loading, you load that set of instructions that are unique only for your app and you continue your work after last time you saved it.
    Last edited by _Al_; 6th Jun 2022 at 13:21.
    Quote Quote  
  27. Image
    [Attachment 65229 - Click to enlarge]

    How could be image stored in temp memory example, if using numpy, but that copies perhaps most scenarios where lines are stored one after each other:
    Code:
    [[#first line (it is in BGR format, not RGB, so first line has max red values only)
      [  0   0 255]
      [  0   0 255]
      [  0   0 255]
      ...
      [  0   0 255]
      [  0   0 255]
      [  0   0 255]]
    
     [#second line (red line again)
      [  0   0 255]
      [  0   0 255]
      [  0   0 255]
      ...
      [  0   0 255]
      [  0   0 255]
      [  0   0 255]]
    ....
     [#last line (blue line)
      [255   0   0]
      [255   0   0]
      [255   0   0]
      ...
      [255   0   0]
      [255   0   0]
      [255   0   0]]]
    So lines are stored one after each other in memory, I'm sure format makes sure it ends with proper DWORD length etc., so technically when loading BMP into an app, data could be interpreted into memory right in the same order like they are arranged in BMP. That is for someone knowledgeable to answer. But point is your app communicates with memory (located on RAM). Where BMP was loaded and stored somewhere else. And also when BMP image is stored from your app (memory) that could take longer, because your code needs to be evaluated from code lines into your memory as a bitmap and then BMP is created and saved.
    Quote Quote  
  28. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by kirito View Post
    i am just intrested to know more about image file formats
    Originally Posted by kirito View Post
    i just wanna draw some images without using modern image formats like png and bmp and also that should be lossless!!
    Originally Posted by kirito View Post
    give commands to graphics and display something which looks like image
    If you don't want to use image formats then why do you want to know about them?
    What is about that "lossless" when you are not saving images to file?
    What kind of commands? Display the plain 3 color squares? For what purpose?
    Quote Quote  
  29. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    To expand on what was just mentioned,

    Media files can be CONCRETE or ABSTRACTED.

    A concrete picture file is an actual raster/bitmap graphic array such as *.BMP or *.PNG, where a 3x3 pixel square in Red looks like this (using "R" instead of a filled rectangle like "█" ):
    Code:
    RRR
    RRR
    RRR
    or...
    Code:
    ███
    ███
    ███
    if you really wanted to use up the whole rectangular character "pixel" area.

    Whereas an abstract picture file is "described" in a higher-level form. The most common types are vector graphics, like *.AI or *.PS, where a set of instructions tell the rasterizing engine (which is necessary because EVERY current display type is raster-based) to draw onto a virtual or real raster. It would look something like this:
    Code:
    Create Square (or Rectangle), 3 units wide by 3 units high, color = Red
    Draw Square
    These are both following common standards (that last one is NOT the actual code, but a stylized synopsis), so that any user can easily both create, share, and consume those files in a highly portable fashion.

    There are similar variations with sound & music files (WAV is concrete, MIDI is abstract) or fonts (printer/screen fonts are concrete - raster, while truetype/opentype/postscript fonts are abstract - vector).
    There is AFAIK no known form of abstracted video, as it would be WAY too huge and cumbersome, although the old sprite animation used by Macromedia (Adobe) Director & Flash had some of that in smaller forms.

    Abstracted files of ALL types need some form of "concretizing" (usually called rendering) engine on the client end in order for it to be mapped to the concrete devices available to the end user. By the way, in terms of mapping, notice how in my abstract example, it used "units" instead of pixels? That's because those units need to be mapped to the concrete device it is outputting to, and that might or might not be a 1:1 mapping. With vector graphics, this works much like an analog Pantograph.

    ***********

    So you want to learn about images/graphics...does that mean concrete images/graphics, or abstract images/graphics, or both? or something else entirely different?
    And when you say you want to learn about them, WHAT do you want to learn?


    Scott
    Last edited by Cornucopia; 6th Jun 2022 at 16:02.
    Quote Quote  
  30. Start here: http://paulbourke.net/dataformats/bitmaps/

    Note that bitmap is a class. BMP is a particular implementation of that class.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!