sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Shailendra Paliwal <beingshailendra@gmail.com>
To: "Måns Rullgård" <mans@mansr.com>
Cc: sox-users@lists.sourceforge.net
Subject: Re: Can I use sox to glitch images?
Date: Sun, 6 May 2018 17:23:43 +0530	[thread overview]
Message-ID: <CAJgyfojw9B7dZ5r0_vVHCyv++6hKSh1n6EDRwj8urbFkxkeqYw@mail.gmail.com> (raw)
In-Reply-To: <yw1xo9hubbiv.fsf@mansr.com>


[-- Attachment #1.1: Type: text/plain, Size: 1950 bytes --]

On Sat, May 5, 2018 at 4:43 PM, Måns Rullgård <mans@mansr.com> wrote:

> Shailendra Paliwal <beingshailendra@gmail.com> writes:
>
> > Hello,
> >
> > I found sox as a command-line equivalent of Audacity. I was wondering how
> > can I glitch images like the way I can using Audacity.
> >
> > On audacity the usual modus operandi is,
> >
> >    1. Use Audacity > File > Import > Raw Data, to import a BMP image
> file.
> >    2. Set the encoding to U-Law or A-Law.
> >    3. Apply audio effects to the track.
> >    4. Export Audio, set Save As Type > Other Uncompressed Files
> >    5. Header > RAW (header-less) and Encoding > whichever selected in (2)
> >    6. Rename to BMP
> >
> > I was wondering if the same method can be used with sox. That way I can
> > make shell scripts to glitch images or even thousands of frames in a
> video.
>
> Yes, this can be done.  Try something like this:
>
> $ sox -t ul -c 1 -r 48k input -t ul output effects...
>
This seems to corrupt the header of the file too and then I cannot open it
at all. Usually in Audacity, I would not touch the first 5% of the track
assuming it contains the header information that should be left untouched.

So, I thought if I can split the header and the file contents into two
file. That would be easy to run through sox.

I tried
$ sox -t ul -c 1 -r 48k water.bmp -t ul water_out trim 0 15 : newfile :
restart

This should work because new headers aren't created while spitting and I
checked this by merging these files back (I'm on windows)
$ type water_out* > water_databent.bmp

This get me the image again.

However, I processed one chunk with an audio effect and the file size
reduced drastically from ~700KB to ~2KB. Would you know why did that
happen? I did
$ sox -t ul -c 1 -r 48k water_out002 -t ul water_out002 echo 0.8 0.7 45 0.31

Now the files don't stitch back to the image either.


> --
> Måns Rullgård
>

[-- Attachment #1.2: Type: text/html, Size: 2810 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

  parent reply	other threads:[~2018-05-06 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 15:51 Can I use sox to glitch images? Shailendra Paliwal
2018-05-05 11:13 ` Måns Rullgård
2018-05-06 10:33   ` James Trammell
2018-05-06 12:18     ` Shailendra Paliwal
2018-05-06 11:53   ` Shailendra Paliwal [this message]
2018-05-06 15:40     ` Måns Rullgård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-users

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJgyfojw9B7dZ5r0_vVHCyv++6hKSh1n6EDRwj8urbFkxkeqYw@mail.gmail.com \
    --to=sox-users@lists.sourceforge.net \
    --cc=mans@mansr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).